From e9d644e8fb2e7fa2f61e4b978f75881d906e0dbc Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 31 Aug 2018 04:47:41 -0700 Subject: [PATCH] ld: Append -mx86-used-note=no to ASFLAGS Since x86 assembler may generate .note.gnu.property section, append -mx86-used-note=no to tests which don't expect .note.gnu.property section on ELF/x86 targets. * testsuite/ld-elf/elf.exp (ASFLAGS): Save, append -mx86-used-note=no and restore. * testsuite/ld-ifunc/ifunc.exp (ASFLAGS): Likewise. * testsuite/ld-scripts/defined.exp (ASFLAGS): Likewise. * testsuite/ld-scripts/overlay-size.exp (ASFLAGS): Likewise --- ld/ChangeLog | 8 ++++++++ ld/testsuite/ld-elf/elf.exp | 8 ++++++++ ld/testsuite/ld-ifunc/ifunc.exp | 8 ++++++++ ld/testsuite/ld-scripts/defined.exp | 8 ++++++++ ld/testsuite/ld-scripts/overlay-size.exp | 9 +++++++++ 5 files changed, 41 insertions(+) diff --git a/ld/ChangeLog b/ld/ChangeLog index a773d9e830b..2d1e90030b8 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2018-08-31 H.J. Lu + + * testsuite/ld-elf/elf.exp (ASFLAGS): Save, append + -mx86-used-note=no and restore. + * testsuite/ld-ifunc/ifunc.exp (ASFLAGS): Likewise. + * testsuite/ld-scripts/defined.exp (ASFLAGS): Likewise. + * testsuite/ld-scripts/overlay-size.exp (ASFLAGS): Likewise. + 2018-08-31 H.J. Lu * testsuite/ld-srec/srec.exp: Append -Wa,-mx86-used-note=no to diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp index bb7f4b04634..96ee01f9b16 100644 --- a/ld/testsuite/ld-elf/elf.exp +++ b/ld/testsuite/ld-elf/elf.exp @@ -95,6 +95,12 @@ if [is_underscore_target] { set ASFLAGS "$ASFLAGS --defsym UNDERSCORE=1" } +global ASFLAGS +set saved_ASFLAGS "$ASFLAGS" +if { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } { + set ASFLAGS "$ASFLAGS -mx86-used-note=no" +} + set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]] foreach t $test_list { # We need to strip the ".d", but can leave the dirname. @@ -102,6 +108,8 @@ foreach t $test_list { run_dump_test [file rootname $t] } +set ASFLAGS "$saved_ASFLAGS" + # Targets using the generic linker backend don't support generating # an import library. set xfail_implib "" diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp index 5fee56d3bf6..2b8084e2b2b 100644 --- a/ld/testsuite/ld-ifunc/ifunc.exp +++ b/ld/testsuite/ld-ifunc/ifunc.exp @@ -45,6 +45,12 @@ if ![check_shared_lib_support] { return } +global ASFLAGS +set saved_ASFLAGS "$ASFLAGS" +if { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } { + set ASFLAGS "$ASFLAGS -mx86-used-note=no" +} + # This test does not need a compiler... run_dump_test "ifuncmod5" @@ -770,3 +776,5 @@ run_ld_link_exec_tests [list \ "-fPIE -O2 -g" \ ] \ ]} + +set ASFLAGS "$saved_ASFLAGS" diff --git a/ld/testsuite/ld-scripts/defined.exp b/ld/testsuite/ld-scripts/defined.exp index f3571b87b14..82e3d0955f2 100644 --- a/ld/testsuite/ld-scripts/defined.exp +++ b/ld/testsuite/ld-scripts/defined.exp @@ -62,6 +62,13 @@ if ![ld_link $ld tmpdir/def "$LDFLAGS -T $srcdir/$subdir/defined.t tmpdir/def.o" } } +global ASFLAGS +set saved_ASFLAGS "$ASFLAGS" +if { [is_elf_format] \ + && ([istarget "i?86-*-*"] || [istarget "x86_64-*-*"]) } { + set ASFLAGS "$ASFLAGS -mx86-used-note=no" +} + set prms_id 0 run_dump_test "defined2" run_dump_test "defined3" @@ -73,3 +80,4 @@ if [is_elf_format] { run_dump_test "defined6" } set LDFLAGS "$saved_LDFLAGS" +set ASFLAGS "$saved_ASFLAGS" diff --git a/ld/testsuite/ld-scripts/overlay-size.exp b/ld/testsuite/ld-scripts/overlay-size.exp index 04c0075b522..b52eb1b0d25 100644 --- a/ld/testsuite/ld-scripts/overlay-size.exp +++ b/ld/testsuite/ld-scripts/overlay-size.exp @@ -22,4 +22,13 @@ if ![is_elf_format] { return } +global ASFLAGS +set saved_ASFLAGS "$ASFLAGS" +if { [is_elf_format] \ + && ([istarget "i?86-*-*"] || [istarget "x86_64-*-*"]) } { + set ASFLAGS "$ASFLAGS -mx86-used-note=no" +} + run_dump_test overlay-size + +set ASFLAGS "$saved_ASFLAGS" -- 2.30.2