aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2018-06-12 13:22:24 +0100
committerNick Clifton <nickc@redhat.com>2018-06-12 13:22:24 +0100
commit212b9bc7b4cfa7702005928dc3bffb3ba3a6e19a (patch)
tree0668a18b780f783bb162bdbfc2afb1fabcf95ce6 /ld
parentd89c18895bfdbf092ff34fd7c593cdab4105b5cc (diff)
downloadfsf-binutils-gdb-212b9bc7b4cfa7702005928dc3bffb3ba3a6e19a.zip
fsf-binutils-gdb-212b9bc7b4cfa7702005928dc3bffb3ba3a6e19a.tar.gz
fsf-binutils-gdb-212b9bc7b4cfa7702005928dc3bffb3ba3a6e19a.tar.bz2
Fix the PR22983 test so that it will work regardless of the order of the symbols in the dynamic symbol table.
See email thread starting here for more details: https://sourceware.org/ml/binutils/2018-06/msg00036.html PR 22983 * testsuite/ld-plugin/lto.exp: Use individual tests to check for the presence of each expected symbol. * testsuite/ld-plugin/pr22983.1.d: New file. * testsuite/ld-plugin/pr22983.2.d: New file. * testsuite/ld-plugin/pr22983.3.d: New file. * testsuite/ld-plugin/pr22983.4.d: New file.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/testsuite/ld-plugin/lto.exp20
-rw-r--r--ld/testsuite/ld-plugin/pr22983.1.d6
-rw-r--r--ld/testsuite/ld-plugin/pr22983.2.d6
-rw-r--r--ld/testsuite/ld-plugin/pr22983.3.d6
-rw-r--r--ld/testsuite/ld-plugin/pr22983.4.d5
6 files changed, 49 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index d8e6a3f..25522c1 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,13 @@
2018-06-12 Nick Clifton <nickc@redhat.com>
+ PR 22983
+ * testsuite/ld-plugin/lto.exp: Use individual tests to check for
+ the presence of each expected symbol.
+ * testsuite/ld-plugin/pr22983.1.d: New file.
+ * testsuite/ld-plugin/pr22983.2.d: New file.
+ * testsuite/ld-plugin/pr22983.3.d: New file.
+ * testsuite/ld-plugin/pr22983.4.d: New file.
+
* emulparams/aarch64elf.sh (OTHER_BSS_END_SYMBOLS): Make the
definition of the __bss_end__ symbol conditional upon CREATE_SHLIB.
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index c0b7b1c..70274b3 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -572,13 +572,29 @@ run_ld_link_exec_tests $lto_run_tests
if { [is_elf_format] } {
run_ld_link_exec_tests $lto_run_elf_tests
+
+ # Note - it is not guaranteed that the ordering of symbols in the dynamic
+ # symbol table will match the ordering of the symbols specified by the
+ # --dynamic-list command line option.
+ #
+ # For PR22983 we want to make sure that all four symbols specified in
+ # pr222983.t are present in the output, but a simple sequences of regexps
+ # will not work as we do not know the order of the symbols. (Readelf
+ # does not have a symbol sorting option and the run_cc_list_tests proc
+ # does not allow for the output of the dump program to piped into `sort`).
+ #
+ # So instead we run readelf four times, each time checking for the
+ # presence of a specific symbol from the pr22983.t file.
run_cc_link_tests [list \
[list \
"Build pr22983" \
"-Wl,--dynamic-list,pr22983.t" \
"-flto" \
- {pr22983a.c pr22983b.c} \
- {{readelf {--dyn-syms --wide} pr22983.d}} \
+ {pr22983a.c pr22983b.c} \
+ {{readelf {--dyn-syms --wide} pr22983.1.d} \
+ {readelf {--dyn-syms --wide} pr22983.2.d} \
+ {readelf {--dyn-syms --wide} pr22983.3.d} \
+ {readelf {--dyn-syms --wide} pr22983.4.d}} \
"pr22983" \
] \
]
diff --git a/ld/testsuite/ld-plugin/pr22983.1.d b/ld/testsuite/ld-plugin/pr22983.1.d
new file mode 100644
index 0000000..1ab19f8
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr22983.1.d
@@ -0,0 +1,6 @@
+Symbol table '\.dynsym' contains [0-9]+ entries:
+ +Num: +Value +Size Type +Bind +Vis +Ndx Name
+#...
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +OBJECT +GLOBAL +DEFAULT +[0-9]+ +_?var_attr_used_enabled
+#pass
+
diff --git a/ld/testsuite/ld-plugin/pr22983.2.d b/ld/testsuite/ld-plugin/pr22983.2.d
new file mode 100644
index 0000000..0f1e6c8
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr22983.2.d
@@ -0,0 +1,6 @@
+Symbol table '\.dynsym' contains [0-9]+ entries:
+ +Num: +Value +Size Type +Bind +Vis +Ndx Name
+#...
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +OBJECT +GLOBAL +DEFAULT +[0-9]+ +_?var_attr_used_disabled
+#pass
+
diff --git a/ld/testsuite/ld-plugin/pr22983.3.d b/ld/testsuite/ld-plugin/pr22983.3.d
new file mode 100644
index 0000000..1bb4f2a
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr22983.3.d
@@ -0,0 +1,6 @@
+Symbol table '\.dynsym' contains [0-9]+ entries:
+ +Num: +Value +Size Type +Bind +Vis +Ndx Name
+#...
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +_?func_attr_used_enabled
+#pass
+
diff --git a/ld/testsuite/ld-plugin/pr22983.4.d b/ld/testsuite/ld-plugin/pr22983.4.d
new file mode 100644
index 0000000..655f824
--- /dev/null
+++ b/ld/testsuite/ld-plugin/pr22983.4.d
@@ -0,0 +1,5 @@
+Symbol table '\.dynsym' contains [0-9]+ entries:
+ +Num: +Value +Size Type +Bind +Vis +Ndx Name
+#...
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +_?func_attr_used_disabled
+#pass