This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: MIPS, strip --only-keep-debug & an infinite loop
- From: Daniel Jacobowitz <drow at false dot org>
- To: "Maciej W. Rozycki" <macro at linux-mips dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 30 Apr 2005 21:50:39 -0400
- Subject: Re: MIPS, strip --only-keep-debug & an infinite loop
- References: <200504282014.j3SKEO8G001654@elgar.sibelius.xs4all.nl> <Pine.LNX.4.61L.0504291249500.32392@blysk.ds.pg.gda.pl> <20050429121900.GD1621@hattusa.textio> <Pine.LNX.4.61L.0504291326090.32392@blysk.ds.pg.gda.pl> <20050429130154.GE1621@hattusa.textio> <20050429130646.GA19824@nevyn.them.org> <Pine.LNX.4.61L.0504291413340.32392@blysk.ds.pg.gda.pl> <20050429135107.GA21441@nevyn.them.org> <Pine.LNX.4.61L.0504291458240.32392@blysk.ds.pg.gda.pl>
On Fri, Apr 29, 2005 at 04:16:27PM +0100, Maciej W. Rozycki wrote:
> > > But I've tried with a different target and the result is weird -- all
> > > non-debugging sections are merged to overlap starting from the same file
> > > offset, keeping their sizes, VMA, etc. intact... Program headers, if
> > > present, get adjusted accordingly.
> >
> > You missed the vital bit. They all become NOBITS sections. The
> > original file still has their original contents; they are only in this
> > file because .symtab will have contents, and it references section
> > numbers.
>
> That makes sense. And with readelf I can see the problem now --
> ".MIPS.options" is left marked as SHT_MIPS_OPTIONS as opposed to
> SHT_NOBITS. Since that section no longer contains anything relevant, it
> should be considered a bug.
Hmm... I'm not completely sure, but your explanation is definitely
plausible. But BFD does a lot of things based on section name. Will
it actually help if the section is SHT_NOBITS, if its name is still
.MIPS.options?
> > > Then the affected sections should get completely
> > > removed and not mangled like currently, avoiding the problem altogether.
> > > Removing ".MIPS.options" alongside ".text", ".data", etc. is of course
> > > something that's beyond the MIPS64 ELF spec and would be quite a
> > > reasonable action to perform.
> >
> > Not at all, because then we could not define debugging symbols in
> > .text.
>
> So again it's bad wording. How about this patch?
>
> 2005-04-29 Maciej W. Rozycki <macro@linux-mips.org>
>
> * doc/binutils.texi (strip, objcopy): Clarify the description of
> the "--strip-debug" option. Fix a typo.
This patch is OK.
--
Daniel Jacobowitz
CodeSourcery, LLC