+ [list \
+ "Run pr18900" \
+ "tmpdir/pr18900.o tmpdir/pr18900.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { dummy.s } \
+ "pr18900" \
+ "pr18900.out" \
+ ] \
+ [list \
+ "Run pr19031" \
+ "$NOPIE_LDFLAGS tmpdir/pr19031.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr19031b.S pr19031c.c } \
+ "pr19031" \
+ "pr19031.out" \
+ "$NOPIE_CFLAGS" \
+ ] \
+ [list \
+ "Run got1" \
+ "$NOPIE_LDFLAGS tmpdir/got1d.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { got1a.S got1b.c got1c.c } \
+ "got1" \
+ "got1.out" \
+ ] \
+ [list \
+ "Run property 1" \
+ "" \
+ "-Wa,-mx86-used-note=yes" \
+ {pass.c property-no-copy.S} \
+ "property-1" "pass.out" \
+ ] \
+ [list \
+ "Run property 1 (PIE)" \
+ "-pie" \
+ "-Wa,-mx86-used-note=yes" \
+ {pass.c property-no-copy.S} \
+ "property-1-pie" "pass.out" "-fPIE" \
+ ] \
+ [list \
+ "Run property 1 (static)" \
+ "-static" \
+ "-Wa,-mx86-used-note=yes" \
+ {pass.c property-no-copy.S} \
+ "property-1-static" "pass.out" \
+ ] \
+ [list \
+ "Run property 2" \
+ "" \
+ "-Wa,-mx86-used-note=yes" \
+ {pass.c property-stack.S} \
+ "property-2" "pass.out" \
+ ] \
+ [list \
+ "Run property 2 (PIE)" \
+ "-pie" \
+ "-Wa,-mx86-used-note=yes" \
+ {pass.c property-stack.S} \
+ "property-2-pie" "pass.out" "-fPIE" \
+ ] \
+ [list \
+ "Run property 2 (static)" \
+ "-static" \
+ "-Wa,-mx86-used-note=yes" \
+ {pass.c property-stack.S} \
+ "property-3-static" "pass.out" \
+ ] \
+ [list \
+ "Run property 3" \
+ "" \
+ "-Wa,-mx86-used-note=yes" \
+ {pass.c property-stack.S property-x86-1.S} \
+ "property-3" "pass.out" \
+ ] \
+ [list \
+ "Run property 3 (PIE)" \
+ "-pie" \
+ "-Wa,-mx86-used-note=yes" \
+ {pass.c property-x86-1.S property-stack.S} \
+ "property-3-pie" "pass.out" "-fPIE" \
+ ] \
+ [list \
+ "Run property 3 (static)" \
+ "-static" \
+ "-Wa,-mx86-used-note=yes" \
+ {property-x86-1.S pass.c property-stack.S} \
+ "property-3-static" "pass.out" \
+ ] \
+ [list \
+ "Run property 4" \
+ "" \
+ "-Wa,-mx86-used-note=yes" \
+ {pass.c property-stack.S property-x86-1.S property-x86-2.S} \
+ "property-4" "pass.out" \
+ ] \
+ [list \
+ "Run property 4 (PIE)" \
+ "-pie" \
+ "-Wa,-mx86-used-note=yes" \
+ {pass.c property-x86-2.S property-x86-1.S property-stack.S} \
+ "property-4-pie" "pass.out" "-fPIE" \
+ ] \
+ [list \
+ "Run property 4 (static)" \
+ "-static" \
+ "-Wa,-mx86-used-note=yes" \
+ {property-x86-2.S property-x86-1.S pass.c property-stack.S} \
+ "property-4-static" "pass.out" \
+ ] \
+ [list \
+ "Run property 5" \
+ "-Wl,-z,stack-size=0x900000" \
+ "-Wa,-mx86-used-note=yes" \
+ {pass.c property-stack.S property-x86-1.S property-x86-2.S} \
+ "property-5" "pass.out" \
+ ] \
+ [list \
+ "Run property 5 (PIE)" \
+ "-pie -Wl,-z,stack-size=0x900000" \
+ "-Wa,-mx86-used-note=yes" \
+ {pass.c property-x86-2.S property-x86-1.S property-stack.S} \
+ "property-5-pie" "pass.out" "-fPIE" \
+ ] \
+ [list \
+ "Run property 5 (static)" \
+ "-static -Wl,-z,stack-size=0x900000" \
+ "-Wa,-mx86-used-note=yes" \
+ {property-x86-2.S property-x86-1.S pass.c property-stack.S} \
+ "property-5-static" "pass.out" \
+ ] \
+ ]
+
+ undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS"
+ undefined_weak "-fPIE" "$NOPIE_LDFLAGS"
+ undefined_weak "-fPIE" "-pie"
+ undefined_weak "-fPIE" "-z nodynamic-undefined-weak $NOPIE_LDFLAGS"
+ undefined_weak "-fPIE" "-pie -z nodynamic-undefined-weak"
+}
+
+global NOPIE_CFLAGS NOPIE_LDFLAGS
+
+# Must be native with the C compiler and working IFUNC support,
+if { [isnative]
+ && [check_ifunc_available]
+ && [istarget "i?86-*-*"]
+ && [check_compiler_available] } {
+ run_cc_link_tests [list \
+ [list \
+ "Build ifunc-1a.o ifunc-1b.o ifunc-1c.o ifunc-1d.o" \
+ "" \
+ "-fPIC -O2 -g -Wa,-mx86-used-note=yes" \
+ { ifunc-1a.c ifunc-1b.S ifunc-1c.S ifunc-1d.S } \
+ ] \
+ [list \
+ "Build pr21168a.o" \
+ "" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr21168a.c } \
+ ] \
+ [list \
+ "Build pr21168.so" \
+ "-shared" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr21168b.S } \
+ "" \
+ "pr21168.so" \
+ ] \
+ ]
+
+ run_ld_link_exec_tests [list \
+ [list \
+ "Run ifunc-1a" \
+ "tmpdir/ifunc-1a.o tmpdir/ifunc-1b.o \
+ tmpdir/ifunc-1c.o tmpdir/ifunc-1d.o" \
+ "-Wa,-mx86-used-note=yes" \
+ { dummy.c } \
+ "ifunc-1a" \
+ "pass.out" \
+ ] \
+ [list \
+ "Run ifunc-1b" \
+ "--static tmpdir/ifunc-1a.o tmpdir/ifunc-1b.o \
+ tmpdir/ifunc-1c.o tmpdir/ifunc-1d.o" \
+ "-Wa,-mx86-used-note=yes" \
+ { dummy.c } \
+ "ifunc-1b" \
+ "pass.out" \
+ ] \
+ [list \
+ "Run pr21168" \
+ "tmpdir/pr21168a.o tmpdir/pr21168.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { dummy.c } \
+ "pr21168" \
+ "pass.out" \
+ ] \
+ ]
+
+ if { [istarget "i?86-*-linux*"] } {
+ run_cc_link_tests [list \
+ [list \
+ "Build pr21168.so with -z ibtplt" \
+ "-shared -Wl,-z,ibtplt" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr21168b.S } \
+ "" \
+ "pr21168-ibt.so" \
+ ] \
+ [list \
+ "Build ifunc-1a with -z ibtplt" \
+ "-Wl,-z,ibtplt $NOPIE_LDFLAGS tmpdir/ifunc-1a.o \
+ tmpdir/ifunc-1b.o tmpdir/ifunc-1c.o tmpdir/ifunc-1d.o" \
+ "-Wa,-mx86-used-note=yes" \
+ { dummy.c } \
+ {{objdump {-dw} plt-main-ibt.dd}} \
+ "ifunc-1a-ibt" \
+ ] \
+ [list \
+ "Build ifunc-1a with PIE -z ibtplt" \
+ "-Wl,-z,ibtplt -pie tmpdir/ifunc-1a.o \
+ tmpdir/ifunc-1b.o tmpdir/ifunc-1c.o tmpdir/ifunc-1d.o" \
+ "-Wa,-mx86-used-note=yes" \
+ { dummy.c } \
+ {{objdump {-dw} plt-pie-ibt.dd}} \
+ "ifunc-1a-pie-ibt" \
+ ] \
+ ]
+
+ run_ld_link_exec_tests [list \
+ [list \
+ "Run ifunc-1a with -z ibtplt" \
+ "-Wl,-z,ibtplt $NOPIE_LDFLAGS tmpdir/ifunc-1a.o \
+ tmpdir/ifunc-1b.o tmpdir/ifunc-1c.o tmpdir/ifunc-1d.o" \
+ "-Wa,-mx86-used-note=yes" \
+ { dummy.c } \
+ "ifunc-1a-ibt" \
+ "pass.out" \
+ ] \
+ [list \
+ "Run ifunc-1a with PIE -z ibtplt" \
+ "-Wl,-z,ibtplt -pie tmpdir/ifunc-1a.o \
+ tmpdir/ifunc-1b.o tmpdir/ifunc-1c.o tmpdir/ifunc-1d.o" \
+ "-Wa,-mx86-used-note=yes" \
+ { dummy.c } \
+ "ifunc-1a-pie-ibt" \
+ "pass.out" \
+ ] \
+ [list \
+ "Run pr21168 with -z ibtplt" \
+ "tmpdir/pr21168a.o tmpdir/pr21168-ibt.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { dummy.c } \
+ "pr21168-ibt" \
+ "pass.out" \
+ ] \
+ ]
+ }
+}
+
+# Must be native with the C compiler.
+if { [isnative]
+ && [istarget "i?86-*-*"]
+ && [check_compiler_available] } {
+ run_cc_link_tests [list \
+ [list \
+ "Build pr22001-1.so" \
+ "-shared" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr22001-1a.c } \
+ {} \
+ "pr22001-1.so" \
+ ] \
+ [list \
+ "Build pr21997-1.so" \
+ "-shared" \
+ "-Wa,-mx86-used-note=yes" \
+ { property-stack.S property-no-copy.S pr21997-1a.S } \
+ {} \
+ "pr21997-1.so" \
+ ] \
+ [list \
+ "Build pr22842.so" \
+ "-shared" \
+ "-fPIC -Wa,-mx86-used-note=yes" \
+ { pr22842a.c } \
+ {} \
+ "pr22842.so" \
+ ] \
+ ]
+
+ run_ld_link_exec_tests [list \
+ [list \
+ "Run weakundef1 without PIE" \
+ "$NOPIE_LDFLAGS" \
+ "-Wa,-mx86-used-note=yes" \
+ { weakundef1.c } \
+ "weakundef1pie" \
+ "pass.out" \
+ "$NOPIE_CFLAGS" \
+ ] \
+ [list \
+ "Run pr22001-1" \
+ "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr22001-1b.c } \
+ "pr22001-1" \
+ "pass.out" \
+ "$NOPIE_CFLAGS" \
+ ] \
+ [list \
+ "Run pr22001-1 (PIE 1)" \
+ "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr22001-1c.S } \
+ "pr22001-1-pie-1" \
+ "pass.out" \
+ ] \
+ [list \
+ "Run pr22001-1 (PIE 2)" \
+ "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr22001-1c.S } \
+ "pr22001-1-pie-2" \
+ "pass.out" \
+ ] \
+ [list \
+ "Run pr22001-1 (PIC 1)" \
+ "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr22001-1b.c } \
+ "pr22001-1-pic-1" \
+ "pass.out" \
+ "-fPIC" \
+ ] \
+ [list \
+ "Run pr22001-1 (PIC 2)" \
+ "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr22001-1b.c } \
+ "pr22001-1-pic-2" \
+ "pass.out" \
+ "-fPIC" \
+ ] \
+ [list \
+ "Run pr21997-1" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr21997-1b.c } \
+ "pr21997-1" \
+ "pass.out" \
+ "$NOPIE_CFLAGS" \
+ ] \
+ [list \
+ "Run pr21997-1 (PIC 1)" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr21997-1b.c } \
+ "pr21997-1-pic-1" \
+ "pass.out" \
+ "-fPIC" \
+ ] \
+ [list \
+ "Run pr21997-1 (PIC 2)" \
+ "-pie -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr21997-1b.c } \
+ "pr21997-1-pic-2" \
+ "pass.out" \
+ "-fPIC" \
+ ] \
+ [list \
+ "Run pr21997-1 (PIE 1)" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr21997-1c.S } \
+ "pr21997-1-pie-1" \
+ "pass.out" \
+ ] \
+ [list \
+ "Run pr21997-1 (PIE 2)" \
+ "-pie -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr21997-1c.S } \
+ "pr21997-1-pie-2" \
+ "pass.out" \
+ ] \
+ [list \
+ "Build pr22842" \
+ "-pie -Wl,--no-as-needed tmpdir/pr22842.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr22842b.S } \
+ "pr22842" \
+ "pass.out" \
+ ] \
+ [list \
+ "Run pr23997" \
+ "" \
+ "" \
+ { ../ld-x86-64/pr23997a.s ../ld-x86-64/pr23997b.c \
+ ../ld-x86-64/pr23997c.c } \
+ "pr23997" \
+ "pass.out" \
+ ] \