This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
V2 [PATCH 7/7] ld: Append -mx86-used-note=no to ASFLAGS
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: binutils at sourceware dot org
- Date: Tue, 28 Aug 2018 08:23:01 -0700
- Subject: V2 [PATCH 7/7] ld: Append -mx86-used-note=no to ASFLAGS
- References: <20180828152301.5360-1-hjl.tools@gmail.com>
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.
---
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 +++++++++
4 files changed, 33 insertions(+)
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index bb7f4b0463..96ee01f9b1 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 5fee56d3bf..2b8084e2b2 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 f3571b87b1..82e3d0955f 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 04c0075b52..b52eb1b0d2 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.17.1