PR26065, ld/testsuite/ld-elf symbolic tests dl4e and dl4f fail

Message ID 20200609080415.GH8533@bubble.grove.modra.org
State New
Headers show
Series
  • PR26065, ld/testsuite/ld-elf symbolic tests dl4e and dl4f fail
Related show

Commit Message

Alan Modra via Binutils June 9, 2020, 8:04 a.m.
Details in the PR.  Basically if your target/compiler generates .dynbss
copies of shared library variables then -Bsymbolic or --dynamic-list
shared libraries will be broken.  So use a -fPIC main to avoid copies
and the target/compiler output differences.

	PR 26065
	* testsuite/ld-elf/shared.exp: Compile dl4main.c -fPIC.
	(dl4e, dl4f): Expect dl4a.out.
	* testsuite/ld-elf/dl4e.out: Delete.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/ld/testsuite/ld-elf/dl4e.out b/ld/testsuite/ld-elf/dl4e.out
deleted file mode 100644
index e5da6e2185..0000000000
--- a/ld/testsuite/ld-elf/dl4e.out
+++ /dev/null
@@ -1,6 +0,0 @@ 
-bar OK2
-bar OK4
-DSO1
-DSO2
-OK2
-OK4
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index effa3ab376..b1e1f62d50 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -921,22 +921,22 @@  set run_tests [list \
      {dl2main.c} "dl2k" "dl2a.out" ] \
     [list "Run with libdl4a.so" \
      "-Wl,--no-as-needed tmpdir/libdl4a.so" "" \
-     {dl4main.c} "dl4a" "dl4a.out" ] \
+     {dl4main.c} "dl4a" "dl4a.out" "-fPIC"] \
     [list "Run with libdl4b.so" \
      "-Wl,--no-as-needed tmpdir/libdl4b.so" "" \
-     {dl4main.c} "dl4b" "dl4a.out" ] \
+     {dl4main.c} "dl4b" "dl4a.out" "-fPIC"] \
     [list "Run with libdl4c.so" \
      "-Wl,--no-as-needed tmpdir/libdl4c.so" "" \
-     {dl4main.c} "dl4c" "dl4b.out" ] \
+     {dl4main.c} "dl4c" "dl4b.out" "-fPIC"] \
     [list "Run with libdl4d.so" \
      "-Wl,--no-as-needed tmpdir/libdl4d.so" "" \
-     {dl4main.c} "dl4d" "dl4b.out" ] \
+     {dl4main.c} "dl4d" "dl4b.out" "-fPIC"] \
     [list "Run with libdl4e.so" \
      "-Wl,--no-as-needed tmpdir/libdl4e.so" "" \
-     {dl4main.c} "dl4e" "dl4e.out" ] \
+     {dl4main.c} "dl4e" "dl4a.out" "-fPIC"] \
     [list "Run with libdl4f.so" \
      "-Wl,--no-as-needed tmpdir/libdl4f.so" "" \
-     {dl4main.c} "dl4f" "dl4e.out" ] \
+     {dl4main.c} "dl4f" "dl4a.out" "-fPIC"] \
     [list "Run with libdata1.so" \
      "-Wl,--no-as-needed tmpdir/libdata1.so" "" \
      {dynbss1.c} "dynbss1" "pass.out" ] \