[forwarded from http://bugs.debian.org/562822]
I (mistakenly) tried to link a file using -lstdc++ before the object file:
$ ld --version-script=ExportMap.map -lstdc++ foo.o
However ld has crashed, and told me to file a bugreport:
ld: BFD (GNU Binutils for Debian) 2.20 internal error, aborting at
../../bfd/elflink.c line 8450 in elf_link_check_versioned_symbol
ld: Please report this bug.
Attached is a reduced testcase, to reproduce:
$ cat >ExportMap.map <<EOF
{
global: main;
local: *;
};
EOF
$ g++ -c x.ii -o foo.o
$ ld --version-script=ExportMap.map -lstdc++ foo.o
ld: warning: cannot find entry symbol _start; defaulting to 0000000000400610
foo.o: In function `__static_initialization_and_destruction_0(int, int)':
x.ii:(.text+0x5e): undefined reference to `__dso_handle'
ld: BFD (GNU Binutils for Debian) 2.20 internal error, aborting at
../../bfd/elflink.c line 8450 in elf_link_check_versioned_symbol
ld: Please report this bug.
If I put -lstdc++ after the object file then ld doesn't crash:
$ ld --version-script=ExportMap.map foo.o -lstdc++
ld: warning: cannot find entry symbol _start; defaulting to 0000000000400610
foo.o: In function `__static_initialization_and_destruction_0(int, int)':
x.ii:(.text+0x5e): undefined reference to `__dso_handle'
Also if I don't use the export map it doesn't crash:
$ ld -lstdc++ foo.o
ld: warning: cannot find entry symbol _start; defaulting to 0000000000400640
foo.o: In function `__static_initialization_and_destruction_0(int, int)':
x.ii:(.text+0x5e): undefined reference to `__dso_handle'
$ ld -v
GNU ld (GNU Binutils for Debian) 2.20
--
Summary: ld: internal error when using -lstdc++ and version
script before object files
Product: binutils
Version: 2.20
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: doko at debian dot org
CC: bug-binutils at gnu dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=11138
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
_______________________________________________
bug-binutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-binutils