This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld --as-needed assertion fail, BFD internal error and crash
On Sat, Mar 18, 2006 at 10:21:04PM +0300, Dmitry V. Levin wrote:
> Without --as-needed fixes it produced a warning
> /usr/bin/ld: warning: libfoo1.so, needed by ./libfoo2.so, not found (try using -rpath or -rpath-link)
> but linked executable.
>
> With --as-needed fixes it fails:
> /usr/bin/ld: warning: libfoo1.so, needed by ./libfoo2.so, not found (try using -rpath or -rpath-link)
> ./libfoo2.so: undefined reference to `foo1'
> collect2: ld returned 1 exit status
Yes, that's a bugfix, the ??? in the comment below for the old as-needed
code.
/* Called via elf_link_hash_traverse, elf_smash_syms sets all symbols
belonging to NOT_NEEDED to bfd_link_hash_new. We know there are no
references from regular objects to these symbols.
??? Should we do something about references from other dynamic
obects? If not, we potentially lose some warnings about undefined
symbols. But how can we recover the initial undefined / undefweak
state? */
--
Alan Modra
IBM OzLabs - Linux Technology Centre