V2 [PATCH 6/7] ld: Append -Wa,-mx86-used-note=no for S-records tests

H.J. Lu hjl.tools@gmail.com
Tue Aug 28 15:23:00 GMT 2018


Since x86 assembler may generate .note.gnu.property section and S-records
can't handle .note.gnu.property sections, add -mx86-used-note=no to
S-records tests on ELF/x86 targets to avoid .note.gnu.property section.

	* testsuite/ld-srec/srec.exp: Append -Wa,-mx86-used-note=no to
	CC and CXX on ELF/x86 targets.
---
 ld/testsuite/ld-srec/srec.exp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ld/testsuite/ld-srec/srec.exp b/ld/testsuite/ld-srec/srec.exp
index d155c18f2c..440112c756 100644
--- a/ld/testsuite/ld-srec/srec.exp
+++ b/ld/testsuite/ld-srec/srec.exp
@@ -357,6 +357,13 @@ set CC "$CC $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS"
 set old_CXX "$CXX"
 set CXX "$CXX $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS"
 
+# S-records can't handle .note.gnu.property sections.
+if { [is_elf_format] \
+     && ([istarget "i?86-*-*"] || [istarget "x86_64-*-*"]) } {
+    set CC "$CC -Wa,-mx86-used-note=no"
+    set CXX "$CXX -Wa,-mx86-used-note=no"
+}
+
 if { ![ld_compile $CC $srcdir/$subdir/sr1.c tmpdir/sr1.o] \
      || ![ld_compile $CC $srcdir/$subdir/sr2.c tmpdir/sr2.o] } {
     unresolved $test1
-- 
2.17.1



More information about the Binutils mailing list