mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-21 04:42:53 +08:00
3c5fce9bc2
When -static -E/--dynamic-list are passed to linker, linker may create executable with dynamic sections which aren't supported by run-time. We require --no-dynamic-linker together with -static -E/--dynamic-list before adding dynamic symbol table to static executable. bfd/ PR ld/19617 PR ld/21086 * elflink.c (elf_link_add_object_symbols): Require --no-dynamic-linker with -E/--dynamic-list when creating dynamic sections. ld/ PR ld/19617 PR ld/21086 * testsuite/ld-elf/pr19617a.d: Pass --no-dynamic-linker to ld. * testsuite/ld-elf/pr19617b.d: Likewise. * testsuite/ld-elf/pr19617c.d: Likewise. *testsuite/ld-i386/pr19636-4d.d: Likewise. * testsuite/ld-elf/readelf.exp: Pass --no-dynamic-linker to ld with --export-dynamic. * testsuite/ld-elf/shared.exp: Pass --no-dynamic-linker to ld with -E.
14 lines
396 B
Makefile
14 lines
396 B
Makefile
#source: pr19617.s
|
|
#ld: -E --no-dynamic-linker
|
|
#readelf : --dyn-syms --wide
|
|
#target: *-*-linux* *-*-gnu* *-*-solaris*
|
|
|
|
Symbol table '\.dynsym' contains [0-9]+ entries:
|
|
+Num: +Value +Size Type +Bind +Vis +Ndx Name
|
|
+0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +
|
|
#...
|
|
+[0-9]+: +[a-f0-9]+ +0 +FUNC +GLOBAL +DEFAULT +[0-9]+ +start
|
|
#...
|
|
+[0-9]+: +[a-f0-9]+ +0 +OBJECT +GLOBAL +DEFAULT +[0-9]+ +bar
|
|
#pass
|