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]

[RFA] PR ld/20995: MIPS: Set GAS flags correctly for tests


	ld/
	PR ld/20995
	* testsuite/ld-elf/elf.exp: Set GAS flags correctly for the 
	`mips*-*-*' target and `pr20995' and `pr20995-2' tests.
---
On Mon, 26 Dec 2016, Alan Modra wrote:

> Of the targets I regularly test, the following fail the new test:
> am33_2.0-linux  +FAIL: pr20995
> arc-linux-uclibc  +FAIL: pr20995
> crisv32-linux  +FAIL: pr20995
> hppa64-hp-hpux11.23  +FAIL: pr20995
> hppa64-linux  +FAIL: pr20995
> i370-linux  +FAIL: Build pr20995.so
> i370-linux  +FAIL: pr20995
> m68k-elf  +FAIL: pr20995
> m68k-linux  +FAIL: pr20995
> mips64-linux  +FAIL: pr20995
> mipsel-linux-gnu  +FAIL: pr20995
> mipsisa32el-linux  +FAIL: pr20995
> mips-linux  +FAIL: pr20995
> mn10300-elf  +FAIL: pr20995
> riscv32-elf  +FAIL: pr20995
> riscv64-elf  +FAIL: pr20995
> score-elf  +FAIL: pr20995
> sh-linux  +FAIL: pr20995
> shl-unknown-netbsdelf  +FAIL: pr20995
> tic6x-elf  +FAIL: pr20995
> vax-netbsdelf  +FAIL: pr20995
> 
> mips apparently needs a tweak to run the testcase with the right
> flags.

 Fixed with the change proposed here, verified across my usual set of MIPS 
targets.

 As this touches your TCL code in what is perhaps a non-obvious way I'll 
give you 48 hours to object before I commit this to master and 2.28.

> tic6x doesn't want to create any dynamic relocs for the testcase.

 You may need to add extra flags as I did with my fix for PR ld/20828 (and 
some earlier works): `-mpic -mpid=near' for GAS and `-melf32_tic6x_le' for 
LD.  This may be needed for some other tests recently added that fail or 
have been XFAILed for `tic6x-*-*' targets.  Joseph might be able to say 
more or perhaps offer a patch even.

> I don't intend to do much more on this over Christmas and New Year, so 
> if your favourite target is one of those that fails the test it's 
> likely that 2.28 will go out without the fix unless target maintainers 
> step up.

 So I did. :)

  Maciej

binutils-mips-ld-test-pr20995-cpic-fix.diff
Index: binutils/ld/testsuite/ld-elf/elf.exp
===================================================================
--- binutils.orig/ld/testsuite/ld-elf/elf.exp	2017-01-16 19:13:12.381862451 +0000
+++ binutils/ld/testsuite/ld-elf/elf.exp	2017-01-17 01:33:50.593215816 +0000
@@ -83,6 +83,13 @@ if { ![istarget hppa64*-hpux*] } {
 
 # Only run these tests on targets that support creating shared libraries.
 if { [check_shared_lib_support] } then {
+    # This target requires extra GAS options when building non-PIC code
+    # for linking with shared libraries.
+    set AFLAGS_NONPIC ""
+    if [istarget "mips*-*-*"] {
+	append AFLAGS_NONPIC " -call_nonpic"
+    }
+
     # Run a test to check linking a shared library with a broken linker
     # script that accidentally marks dynamic sections as notes.  The
     # resulting executable is not expected to work, but the linker
@@ -142,17 +149,17 @@ if { [check_shared_lib_support] } then {
     }
     # These targets don't copy dynamic variables into .bss.
     setup_xfail "alpha-*-*" "bfin-*-*" "ia64-*-*" "xtensa-*-*"
-    run_ld_link_tests {
-	{"pr20995"
-	    "" "tmpdir/pr20995.so" ""
-	    {pr20995a.s} {{readelf {-S --wide} pr20995.r}} "pr20995"}
-    }
+    run_ld_link_tests [list \
+	[list \
+	    "pr20995" \
+	    "" "tmpdir/pr20995.so" "$AFLAGS_NONPIC" \
+	    {pr20995a.s} {{readelf {-S --wide} pr20995.r}} "pr20995"]]
     setup_xfail "alpha-*-*" "bfin-*-*" "ia64-*-*" "xtensa-*-*"
-    run_ld_link_tests {
-	{"pr20995-2"
-	    "" "tmpdir/pr20995-2.so" ""
-	    {pr20995a.s} {{readelf {-S --wide} pr20995.r}} "pr20995-2"}
-    }
+    run_ld_link_tests [list \
+	[list \
+	    "pr20995-2" \
+	    "" "tmpdir/pr20995-2.so" "$AFLAGS_NONPIC" \
+	    {pr20995a.s} {{readelf {-S --wide} pr20995.r}} "pr20995-2"]]
 }
 
 set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]


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