This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Change in ld behavior between 2.16.1 and 2.17
On Sun, Sep 09, 2007 at 02:10:01PM +0930, Alan Modra wrote:
> On Wed, Sep 05, 2007 at 12:19:05PM -0500, Albert Chin wrote:
> [about references to local symbols in discarded sections causing a
> link error]
> > Is the behavior in binutils-2.17+ correct?
>
> Well, the linker can't guarantee to fix up the reference to point to
> the proper location in the kept section. Just considering the linker
> in isolation, I think it warrants an error. However, I thought this
> gcc bug had been fixed long ago, but if this is occurring with 4.0.2,
> perhaps we ought to downgrade the error to a warning again. (I'm
> assuming that the reference was from C++ code rather than assembly,
> and that your .a was actually compiled with 4.0.2)
It's fixed in gcc-4.1.x and later:
http://gcc.gnu.org/viewcvs?view=rev&revision=99395
> > If so, how do we work around this issue?
>
> Pass --noinhibit-exec to the linker.
Thanks.
--
albert chin (china@thewrittenword.com)