This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FAIL: Build pr22983 (both x86-64 and aarch64, Gentoo)


Am Montag, 11. Juni 2018, 14:07:04 CEST schrieb Nick Clifton:
>
> So ...  please could you try out the attached patch, which uses a rather
> hackish method to work around the problem - it runs the check four times,
> once for each symbol, each time ignoring any other symbol.  I think that
> should work for you, but I would like to be sure.

The patch was somehow garbled (git made the test files in the wrong path, and 
claimed the last line was cut off). Anyway, 

After fixing this (see attachment) the test passes fine here. (binutils 2.30, 
~ tip of release branch).

Thank you!

-- 
Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer
(council, toolchain, perl, libreoffice, comrel)
>From 2011b5b7770dc71367ef94176779abf72f96f092 Mon Sep 17 00:00:00 2001
From: Nick Clifton <nickc@redhat.com>
Date: Tue, 12 Jun 2018 00:59:57 +0200
Subject: [PATCH] Fix test pr22983 for the case where the symbols are out of
 order

---
 ld/testsuite/ld-plugin/lto.exp     | 20 ++++++++++++++++++--
 ld/testsuite/ld-plugin/pr22983.1.d |  6 ++++++
 ld/testsuite/ld-plugin/pr22983.2.d |  6 ++++++
 ld/testsuite/ld-plugin/pr22983.3.d |  6 ++++++
 ld/testsuite/ld-plugin/pr22983.4.d |  5 +++++
 5 files changed, 41 insertions(+), 2 deletions(-)
 create mode 100644 ld/testsuite/ld-plugin/pr22983.1.d
 create mode 100644 ld/testsuite/ld-plugin/pr22983.2.d
 create mode 100644 ld/testsuite/ld-plugin/pr22983.3.d
 create mode 100644 ld/testsuite/ld-plugin/pr22983.4.d

diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp
index 4bd2ada0ea..a18088c281 100644
--- a/ld/testsuite/ld-plugin/lto.exp
+++ b/ld/testsuite/ld-plugin/lto.exp
@@ -564,13 +564,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 0000000000..1ab19f8145
--- /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 0000000000..0f1e6c88e6
--- /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 0000000000..1bb4f2a4f2
--- /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 0000000000..655f824db7
--- /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
-- 
2.17.1

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]