Bug 2469 - assertion fails in BFD elflink.c when using --Wl.--as-needed
Summary: assertion fails in BFD elflink.c when using --Wl.--as-needed
Status: RESOLVED DUPLICATE of bug 2434
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.16
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-19 00:24 UTC by Francesco Montorsi
Modified: 2006-03-19 01:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francesco Montorsi 2006-03-19 00:24:01 UTC
When calling:

g++ app_wxluacan_wxluacan.o app_wxluacan_cancom.o app_wxluacan_wxluacan_bind.o
app_wxluacan_cansim.o app_wxluacan_canlua.o -Wl,--as-needed -o ../bin/wxluacan
-L../lib -lwxlua_gtk2_wxlua-2.6 -lwxlua_gtk2_wxbind-2.6
-lwxlua_gtk2_wxluasocket-2.6 -lwxlua_gtk2_wxluadebug-2.6 -lwxlua_gtk2_lua-2.6
-lstedit -L/usr/local/lib -lpthread -lwx_gtk2u_stc-2.6 -lwx_gtk2u_xrc-2.6
-lwx_gtk2u_html-2.6 -lwx_gtk2u_adv-2.6 -lwx_baseu_net-2.6 -lwx_baseu_xml-2.6
-lwx_gtk2u_core-2.6 -lwx_baseu-2.6

I always get as output:

/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2324
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2325
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2324
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2325
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2324
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2325
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2324
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2325
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2324
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2325
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2324
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2325
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2324
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2325
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2324
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2325
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2324
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2325
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2324
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux assertion fail ../../bfd/elflink.c:2325
/usr/bin/ld: BFD 2.16.1 Debian GNU/Linux internal error, aborting at
../../bfd/elflink.c line 6419 in elf_link_output_extsym

/usr/bin/ld: Please report this bug.

collect2: ld returned 1 exit status



If I remove the -Wl,--as-needed option from command line, everything works just
fine.

I'm not sure if this is because of some corrupted object file or whatelse.
In any case those assertions are a bug, isn't it?

Note that all libraries given with -l and prefixed with wxlua_ are static while
all libraries given with -l and prefixed with wx_ are shared (.so).


Some info on my system:
uname -m = i686
uname -r = 2.6.12-10-386
uname -s = Linux
Distribution is Ubuntu 5.10.

frm@genius:~/work/wxLua$ ld --version
GNU ld version 2.16.1 Debian GNU/Linux

frm@genius:~/work/wxLua$ gcc --version
gcc (GCC) 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9)

I can easily create a zipped archive containing the object files which give
problems, if you need (~ 7MB uncompressed).
Just let me know...
Comment 1 Alan Modra 2006-03-19 01:49:12 UTC

*** This bug has been marked as a duplicate of 2434 ***