Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* strip and that kernel patch nonsense
@ 1996-05-15 17:54 Richard Henderson
  1996-05-17 16:37 ` Harald Koenig
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Henderson @ 1996-05-15 17:54 UTC (permalink / raw)


*sigh* Forget that last bit about patching the kernel.  Thanks
to David Mosberger for pointing out that I was being stupid.

Try this much simpler binutils patch.

r~

--- bfd/coff-alpha.c.orig	Wed May 15 12:41:26 1996
+++ bfd/coff-alpha.c	Wed May 15 12:41:47 1996
@@ -2262,7 +2262,7 @@
   "________64",
   /* The page boundary used to align sections in a demand-paged
      executable file.  E.g., 0x1000.  */
-  0x2000,
+  0x1000,
   /* True if the .rdata section is part of the text segment, as on the
      Alpha.  False if .rdata is part of the data segment, as on the
      MIPS.  */

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: strip and that kernel patch nonsense
  1996-05-15 17:54 strip and that kernel patch nonsense Richard Henderson
@ 1996-05-17 16:37 ` Harald Koenig
  1996-05-18  4:22   ` Richard Henderson
  0 siblings, 1 reply; 11+ messages in thread
From: Harald Koenig @ 1996-05-17 16:37 UTC (permalink / raw)


> *sigh* Forget that last bit about patching the kernel.  Thanks
> to David Mosberger for pointing out that I was being stupid.
> 
> Try this much simpler binutils patch.

this simple binutils patch didn't work; strip still breaks the
small "idle" program (but now the binary has the same size as with
quickstrip; 32k instead of 40k).

then I've tried your kernel patch and using this one I can run both stripped
programs (with original and patched strip).

if your description about the file offset information in the ECOFF
header is correct I'd think that any patch for the binutils will only
handle the symptoms but not the real reason (and not even the symptoms
seem th be cured by the binutils patch).

Harald

-- 
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: strip and that kernel patch nonsense
  1996-05-17 16:37 ` Harald Koenig
@ 1996-05-18  4:22   ` Richard Henderson
  1996-05-18  9:01     ` Harald Koenig
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Henderson @ 1996-05-18  4:22 UTC (permalink / raw)


Harald Koenig wrote:
> if your description about the file offset information in the ECOFF
> header is correct I'd think that any patch for the binutils will only
> handle the symptoms but not the real reason (and not even the symptoms
> seem th be cured by the binutils patch).

I blame it all on a generally bad day, but the segment size
change really did run the idle program.  After I'd slept I
realized that that shouldn't have worked.

The real problem, (no really!) was flags not being set on
the .pdata section before file offsets were assigned.

Try this.

r~

Index: ecoff.c
===================================================================
RCS file: /home/richard/Repository/cygnus/gas/bfd/ecoff.c,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 ecoff.c
--- ecoff.c     1996/03/23 22:46:11     1.1.1.3
+++ ecoff.c     1996/05/17 05:53:45
@@ -161,7 +161,8 @@
   else if (strcmp (section->name, _RDATA) == 0
           || strcmp (section->name, _LIT8) == 0
           || strcmp (section->name, _LIT4) == 0
-          || strcmp (section->name, _RCONST) == 0)
+          || strcmp (section->name, _RCONST) == 0
+          || strcmp (section->name, _PDATA) == 0)
     section->flags |= SEC_DATA | SEC_LOAD | SEC_ALLOC | SEC_READONLY;
   else if (strcmp (section->name, _BSS) == 0
           || strcmp (section->name, _SBSS) == 0)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: strip and that kernel patch nonsense
  1996-05-18  4:22   ` Richard Henderson
@ 1996-05-18  9:01     ` Harald Koenig
  1996-05-20  6:13       ` Jim Paradis
  0 siblings, 1 reply; 11+ messages in thread
From: Harald Koenig @ 1996-05-18  9:01 UTC (permalink / raw)


> I blame it all on a generally bad day, but the segment size
> change really did run the idle program.  After I'd slept I
> realized that that shouldn't have worked.
> 
> The real problem, (no really!) was flags not being set on
> the .pdata section before file offsets were assigned.

I build a new strip with and without your first segment size patch,
both strip versions still break the idle loop program.

I'm not too familar with the binary format and binutil details;
is this a problem for the "strip" program or do I need to rebuild
gas (since your patch is from gas/bfd/ecoff.c ) ?
                              ^^^
since "quickstrip" works fine, I can't beleave that it's not possible
for "strip" to work correctly without a patch for gas or the kernel ?!

a bit confused,
Harald

-- 
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: strip and that kernel patch nonsense
  1996-05-20  6:13       ` Jim Paradis
@ 1996-05-20  5:48         ` Linus Torvalds
  0 siblings, 0 replies; 11+ messages in thread
From: Linus Torvalds @ 1996-05-20  5:48 UTC (permalink / raw)


On Mon, 20 May 1996, Jim Paradis wrote:
> 
> > since "quickstrip" works fine, I can't beleave that it's not possible
> > for "strip" to work correctly without a patch for gas or the kernel ?!
> 
> Well, "quickstrip" is a quickie utility I wrote way back in the 32-bit
> Linux/Alpha days.  It's a ten-line program that finds the COFF symbol
> table, nukes it in the header, and truncates the file.  Period.

Umm, I hope that quickstrip goes away soon (redhat-3.0.3 still seems to have
an rpm for it). No offence, Jim, but it's a bit _too_ simple-minded. Try to
do "quickstrip /usr/bin/*" some day, and watch what happens to all your
non-ECOFF binaries (like shell scripts etc). Yes, I've done that. Oops, bad
idea. ;-)

		Linus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: strip and that kernel patch nonsense
  1996-05-18  9:01     ` Harald Koenig
@ 1996-05-20  6:13       ` Jim Paradis
  1996-05-20  5:48         ` Linus Torvalds
  0 siblings, 1 reply; 11+ messages in thread
From: Jim Paradis @ 1996-05-20  6:13 UTC (permalink / raw)


> since "quickstrip" works fine, I can't beleave that it's not possible
> for "strip" to work correctly without a patch for gas or the kernel ?!

Well, "quickstrip" is a quickie utility I wrote way back in the 32-bit
Linux/Alpha days.  It's a ten-line program that finds the COFF symbol
table, nukes it in the header, and truncates the file.  Period.

"strip", on the other hand, is part of GNU binutils.  It does all kinds
of fancy stuff including parsing the image through libbfd, performing
a *transform* from input-image-type to output-image-type (even if the
transform is trivial), selecting *which* symbols to nuke (relocations
stay no matter what, f'rinstance) and creating the output image.

That's why it's possible for one to work and not the other 8-)

-- 
Jim Paradis (paradis@amt.tay1.dec.com)        "It's not procrastination, 
Digital Equipment Corporation		       it's my new Just-In-Time 
(508)952-4047				       Workload Management System!"
http://www.tiac.net/users/jrp/index.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: strip and that kernel patch nonsense
       [not found] <m0uLBiU-0001ukC@atheist.tamu.edu>
@ 1996-05-20  7:11 ` Harald Koenig
  1996-05-20  7:41   ` Richard Henderson
  1996-05-20  7:11 ` Harald Koenig
  1 sibling, 1 reply; 11+ messages in thread
From: Harald Koenig @ 1996-05-20  7:11 UTC (permalink / raw)


> Did you, by chance, relink your idle program?  Because the BFD patch
> affects ld not strip.  Perhaps I did not make that clear.

no, I just rebuilt strip and used the olde idle binary.

if it's true that ld has to be fixed, this would mean that all old
binaries are "broken" in some way and may suffer this probem ?
I can test the new ld only tomorrow...

but why is it possible to use "quickstrip" on the "broken" programs with
no problem? does quickstrip fix the real problem which was caused by ld ?

Harald

-- 
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: strip and that kernel patch nonsense
       [not found] <m0uLBiU-0001ukC@atheist.tamu.edu>
  1996-05-20  7:11 ` Harald Koenig
@ 1996-05-20  7:11 ` Harald Koenig
  1 sibling, 0 replies; 11+ messages in thread
From: Harald Koenig @ 1996-05-20  7:11 UTC (permalink / raw)


> Did you, by chance, relink your idle program?  Because the BFD patch
> affects ld not strip.  Perhaps I did not make that clear.

no, I just rebuilt strip and used the olde idle binary.

if it's true that ld has to be fixed, this would mean that all old
binaries are "broken" in some way and may suffer this probem ?
I can test the new ld only tomorrow...

but why is it possible to use "quickstrip" on the "broken" programs with
no problem? does quickstrip fix the real problem which was caused by ld ?

Harald

-- 
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: strip and that kernel patch nonsense
@ 1996-05-20  7:18 David Mosberger-Tang
  0 siblings, 0 replies; 11+ messages in thread
From: David Mosberger-Tang @ 1996-05-20  7:18 UTC (permalink / raw)


>>>>> On Mon, 20 May 1996 08:48:01 +0300 (EET DST), Linus Torvalds <torvalds@cs.Helsinki.FI> said:

  Linus> On Mon, 20 May 1996, Jim Paradis wrote:
  >>  > since "quickstrip" works fine, I can't beleave that it's not
  >> possible > for "strip" to work correctly without a patch for gas
  >> or the kernel ?!
  >> 
  >> Well, "quickstrip" is a quickie utility I wrote way back in the
  >> 32-bit Linux/Alpha days.  It's a ten-line program that finds the
  >> COFF symbol table, nukes it in the header, and truncates the
  >> file.  Period.

  Linus> Umm, I hope that quickstrip goes away soon (redhat-3.0.3
  Linus> still seems to have an rpm for it). No offence, Jim, but it's
  Linus> a bit _too_ simple-minded. Try to do "quickstrip /usr/bin/*"
  Linus> some day, and watch what happens to all your non-ECOFF
  Linus> binaries (like shell scripts etc). Yes, I've done that. Oops,
  Linus> bad idea. ;-)

Don't think it would be that hard to add a little sanity checking to
quickstrip to make sure it doesn't mangle anything but ECOFF files.

As long as "strip" is slow like a dog it seems to me that "quickstrip"
has some value.

	--david

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: strip and that kernel patch nonsense
  1996-05-20  7:11 ` Harald Koenig
@ 1996-05-20  7:41   ` Richard Henderson
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Henderson @ 1996-05-20  7:41 UTC (permalink / raw)


> if it's true that ld has to be fixed, this would mean that all old
> binaries are "broken" in some way and may suffer this probem ?
> I can test the new ld only tomorrow...

Yes, old binaries *may* be broken.  It depends on the specifics
of their section sizes and how they got aligned.  

To be frank, between the two bugs brought to light with your strip
report, I'm surprised anything worked before at all.

> but why is it possible to use "quickstrip" on the "broken" programs with
> no problem? does quickstrip fix the real problem which was caused by ld ?

As Jim Pardis explained, quickstrip simply truncates the file and
twiddles some bits.  Strip, on the other hand, is actually objcopy
with a few defaults.  It performs a complete translation of the 
input file to the output file with a filter in between.

In the time-before-last problem (one liner with _PDATA), the linker
did not have the right flags for the segment so it did not align
it properly.  When strip read the section, it got the flags set
properly, but when it went to write the section back out again,
the changed now-correct flags caused the alignment to change.  This
alignment change breaks programs.

I hope this is somewhat clear.

r~

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: strip and that kernel patch nonsense
       [not found] <Pine.LNX.3.91.960520084514.15762E-100000@linux.cs.Helsinki.FI>
@ 1996-06-06  0:51 ` Erik Troan
  0 siblings, 0 replies; 11+ messages in thread
From: Erik Troan @ 1996-06-06  0:51 UTC (permalink / raw)


On Mon, 20 May 1996, Linus Torvalds wrote:

> Umm, I hope that quickstrip goes away soon (redhat-3.0.3 still seems to have
> an rpm for it). No offence, Jim, but it's a bit _too_ simple-minded. Try to
> do "quickstrip /usr/bin/*" some day, and watch what happens to all your
> non-ECOFF binaries (like shell scripts etc). Yes, I've done that. Oops, bad
> idea. ;-)

Well Linus, "make boot" in the kernel does do "quickstrip vmlinux" as one
of the steps :-)

Erik

-------------------------------------------------------------------------------
   Always hoped that I'd be an apostle. Knew that I would make it if I tried.
     Then when we retire we can write the gospels so they'll all talk about
         us when we die. - "The Last Supper" from Jesus Christ Superstar
|   Erik Troan   =   http://sunsite.unc.edu/ewt/   =   ewt@sunsite.unc.edu    |

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~1996-06-06  0:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-05-15 17:54 strip and that kernel patch nonsense Richard Henderson
1996-05-17 16:37 ` Harald Koenig
1996-05-18  4:22   ` Richard Henderson
1996-05-18  9:01     ` Harald Koenig
1996-05-20  6:13       ` Jim Paradis
1996-05-20  5:48         ` Linus Torvalds
     [not found] <m0uLBiU-0001ukC@atheist.tamu.edu>
1996-05-20  7:11 ` Harald Koenig
1996-05-20  7:41   ` Richard Henderson
1996-05-20  7:11 ` Harald Koenig
  -- strict thread matches above, loose matches on Subject: below --
1996-05-20  7:18 David Mosberger-Tang
     [not found] <Pine.LNX.3.91.960520084514.15762E-100000@linux.cs.Helsinki.FI>
1996-06-06  0:51 ` Erik Troan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox