This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Warning relocs against discarded functions
- To: Geoff Keating <geoffk at redhat dot com>
- Subject: Re: PATCH: Warning relocs against discarded functions
- From: Daniel Jacobowitz <drow at mvista dot com>
- Date: Thu, 1 Nov 2001 18:35:32 -0500
- Cc: hjl at lucon dot org, kaos at melbourne dot sgi dot com, gdb at sources dot redhat dot com,binutils at sourceware dot cygnus dot com
- References: <20011031174749.A28985@nevyn.them.org> <30951.1004618590@ocs3.intra.ocs.com.au> <20011101142835.A24773@lucon.org> <200111012323.PAA07634@geoffk.org>
On Thu, Nov 01, 2001 at 03:23:49PM -0800, Geoff Keating wrote:
> > Date: Thu, 1 Nov 2001 14:28:35 -0800
> > From: "H . J . Lu" <hjl@lucon.org>
> > Cc: Daniel Jacobowitz <dan@debian.org>, gdb@sources.redhat.com,
> > binutils@sourceware.cygnus.com
>
> > On Thu, Nov 01, 2001 at 11:43:10PM +1100, Keith Owens wrote:
> > > The problem is worse than stabs. If a function is marked __exit _and_
> > > some code in another section refers to that function then :-
> > >
> > > * ld resolves the reference as offset xxx from the start of section
> > > .text.exit which is expected to get a decent start address.
> > > * Section .text.exit is discarded, giving it a zero start address.
>
> That's not right! When a section is discarded, it goes away, it
> doesn't go to location 0. When a section is not in the final object,
> any non-weak relocations to it (that do make it to the final object)
> are an error, and should be reported as such ("undefined symbol" or
> similar).
If that's so, what would you suggest in the case I described earlier
(I'm pretty sure I sent it to the binutils list...)? The single .stab
section contains relocations to functions in all text sections, as best
I can tell, including the discarded .text.exit section.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer