aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-10-24 18:08:13 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-10-24 18:08:24 -0700
commit0a640d719684f25bdb88ae60148c6978e6131701 (patch)
tree847a75473aa7a2d0009da97e8a8665d2261b44e2 /ld
parent0e139b87870258ce666826efd14fafd543c778d0 (diff)
downloadgdb-0a640d719684f25bdb88ae60148c6978e6131701.zip
gdb-0a640d719684f25bdb88ae60148c6978e6131701.tar.gz
gdb-0a640d719684f25bdb88ae60148c6978e6131701.tar.bz2
ELF: Hide symbols defined in discarded input sections
When assigning symbol version, we should hide debug symbols defined in discarded sections from IR objects so that they can be removed later. bfd/ PR ld/23818 * elflink.c (_bfd_elf_link_assign_sym_version): Hide symbols defined in discarded input sections. ld/ PR ld/23818 * testsuite/ld-plugin/lto.exp: Run PR ld/23818 test. * testsuite/ld-plugin/pr23818.d: New file. * testsuite/ld-plugin/pr23818.t: Likewise. * testsuite/ld-plugin/pr23818a.c: Likewise. * testsuite/ld-plugin/pr23818b.c: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog9
-rw-r--r--ld/testsuite/ld-plugin/lto.exp6
-rw-r--r--ld/testsuite/ld-plugin/pr23818.d4
-rw-r--r--ld/testsuite/ld-plugin/pr23818.t4
-rw-r--r--ld/testsuite/ld-plugin/pr23818a.c4
-rw-r--r--ld/testsuite/ld-plugin/pr23818b.c7
6 files changed, 34 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index f0a373d..6026575 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,12 @@
+2018-10-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/23818
+ * testsuite/ld-plugin/lto.exp: Run PR ld/23818 test.
+ * testsuite/ld-plugin/pr23818.d: New file.
+ * testsuite/ld-plugin/pr23818.t: Likewise.
+ * testsuite/ld-plugin/pr23818a.c: Likewise.
+ * testsuite/ld-plugin/pr23818b.c: Likewise.
+
2018-10-23 Alan Modra <amodra@gmail.com>
* testsuite/ld-elf/shared.exp: Don't build pr19073 test on alpha.
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 18829fd..008bde7 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -219,6 +219,12 @@ set lto_link_tests [list \
[list "Build pr22751.a" \
"$plug_opt" "-flto $lto_no_fat $INT128_CFLAGS" \
{pr22751.c} {} "pr22751.a"] \
+ [list "Build libpr23818.so" \
+ "-shared -flto -g -Wl,-version-script,pr23818.t" \
+ "-g -flto $lto_fat" \
+ {pr23818a.c pr23818b.c} \
+ {{"readelf" {-s --wide} "pr23818.d"}} \
+ "libpr23818.so"] \
]
if { [at_least_gcc_version 4 7] } {
diff --git a/ld/testsuite/ld-plugin/pr23818.d b/ld/testsuite/ld-plugin/pr23818.d
new file mode 100644
index 0000000..5753cd6
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr23818.d
@@ -0,0 +1,4 @@
+#failif
+#...
+.*0+ +[A-Z]+ +GLOBAL +DEFAULT +ABS foo
+#...
diff --git a/ld/testsuite/ld-plugin/pr23818.t b/ld/testsuite/ld-plugin/pr23818.t
new file mode 100644
index 0000000..45bca55
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr23818.t
@@ -0,0 +1,4 @@
+{
+ global: bar;
+ local: *;
+};
diff --git a/ld/testsuite/ld-plugin/pr23818a.c b/ld/testsuite/ld-plugin/pr23818a.c
new file mode 100644
index 0000000..5b5ccbf
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr23818a.c
@@ -0,0 +1,4 @@
+void
+foo ()
+{
+}
diff --git a/ld/testsuite/ld-plugin/pr23818b.c b/ld/testsuite/ld-plugin/pr23818b.c
new file mode 100644
index 0000000..d4be333
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr23818b.c
@@ -0,0 +1,7 @@
+void foo (void);
+
+void
+bar (void)
+{
+ foo ();
+}