Created attachment 5141 [details] Testcase GNU ld (GNU Binutils) 2.21.51.20101123 /usr/local/bin/ld: prog: protected symbol `bar' isn't defined /usr/local/bin/ld: final link failed: Nonrepresentable section on output
CVSROOT: /cvs/src Module name: src Changes by: amodra@sourceware.org 2010-12-04 04:42:07 Modified files: bfd : ChangeLog elflink.c Log message: PR ld/12277 * elflink.c (elf_link_output_extsym): Set bfd_error on symbol and section errors. Allow better translation of error messages. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5202&r2=1.5203 http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elflink.c.diff?cvsroot=src&r1=1.388&r2=1.389
Fixed mainline.
There are still two problems... 1. The "<visibility> symbol `bar' isn't defined" messages are misleading: "hidden" in the sources gives "protected", "protected" gives "internal", and "internal" gives "hidden". It also depends on whether bar() is __const__ or not. 2. Why ld.bfd should fail when ld.gold works fine?
(In reply to comment #3) > There are still two problems... > > 1. The "<visibility> symbol `bar' isn't defined" messages are misleading: > "hidden" in the sources gives "protected", "protected" gives "internal", and > "internal" gives "hidden". It also depends on whether bar() is __const__ or > not. It is fixed by http://sourceware.org/ml/binutils/2010-12/msg00202.html > 2. Why ld.bfd should fail when ld.gold works fine? It will be fixed by http://sourceware.org/ml/binutils/2010-12/msg00197.html
CVSROOT: /cvs/src Module name: src Changes by: hjl@sourceware.org 2010-12-06 00:51:16 Modified files: ld : ChangeLog Log message: Mention PR ld/12277 in ChangeLog. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&r1=1.2243&r2=1.2244
The patch is posted at http://sourceware.org/ml/binutils/2010-12/msg00207.html
Failed with ld.dk.
A patch is posted at http://sourceware.org/ml/binutils/2011-02/msg00010.html
(In reply to comment #7) Recent ld.dk seems to work.
Works in 2.23. Tracked by "LTO 8" test in ld-plugin.