aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-11-28 08:03:46 -0800
committerH.J. Lu <hjl.tools@gmail.com>2016-11-28 08:03:46 -0800
commit4deb8f714d555a2f530e37c3e7af32bc42fdda58 (patch)
tree4f5c4fc9e7e3347ae4e8cb222032d7e64e9231ad /ld/testsuite
parent9e27646a6dedd071bdc8a7ba75eca1faaf500366 (diff)
downloadgdb-4deb8f714d555a2f530e37c3e7af32bc42fdda58.zip
gdb-4deb8f714d555a2f530e37c3e7af32bc42fdda58.tar.gz
gdb-4deb8f714d555a2f530e37c3e7af32bc42fdda58.tar.bz2
Properly hide hidden versioned symbol in executable
A hidden versioned symbol in executable should be forced local if it is locally defined, not referenced by shared library and not exported. We must do it before _bfd_elf_link_renumber_dynsyms. bfd/ * elflink.c (_bfd_elf_fix_symbol_flags): Hide hidden versioned symbol in executable. (elf_link_output_extsym): Don't change bind from global to local when linking executable. ld/ * testsuite/ld-elf/indirect.exp: Add a test for PR 18720. * testsuite/ld-elf/pr18720.rd: New file.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-elf/indirect.exp3
-rw-r--r--ld/testsuite/ld-elf/pr18720.rd4
2 files changed, 7 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/indirect.exp b/ld/testsuite/ld-elf/indirect.exp
index b4766fd..3176210 100644
--- a/ld/testsuite/ld-elf/indirect.exp
+++ b/ld/testsuite/ld-elf/indirect.exp
@@ -91,6 +91,9 @@ set build_tests {
{"Build pr18720b1.o"
"-r -nostdlib tmpdir/pr18720b.o" ""
{dummy.c} {} "pr18720b1.o"}
+ {"Build pr18720a"
+ "tmpdir/pr18720a.o tmpdir/pr18720b.o tmpdir/libpr18720c.so" ""
+ {check-ptr-eq.c} {{readelf {--dyn-syms} pr18720.rd}} "pr18720a"}
{"Build libpr19553b.so"
"-shared -Wl,--version-script=pr19553.map" "-fPIC"
{pr19553b.c} {} "libpr19553b.so"}
diff --git a/ld/testsuite/ld-elf/pr18720.rd b/ld/testsuite/ld-elf/pr18720.rd
new file mode 100644
index 0000000..b5e848f
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr18720.rd
@@ -0,0 +1,4 @@
+#failif
+#...
+.* found at index >= .dynsym's sh_info value .*
+#...