regsub -all -- {([a-z0-9]+)\.pd} $i386tests {\1-nacl.pd} i386tests
}
+proc iamcu_tests {} {
+ if {[istarget "*-*-nacl*"]} then {
+ return
+ }
+
+ global as
+ global srcdir
+ global subdir
+
+ if ![ld_assemble $as "--32 -march=iamcu $srcdir/$subdir/start.s" tmpdir/startiamcu.o] {
+ unresolved "Build Intel MCU start.o"
+ return
+ }
+
+ if ![ld_assemble $as "--32 $srcdir/$subdir/start.s" tmpdir/start32.o] {
+ unresolved "Build ia32 start.o"
+ return
+ }
+
+ if ![ld_assemble $as "--32 -march=iamcu $srcdir/$subdir/foo.s" tmpdir/fooiamcu.o] {
+ unresolved "Build Intel MCU foo.o"
+ return
+ }
+
+ if ![ld_assemble $as "--32 $srcdir/$subdir/foo.s" tmpdir/foo32.o] {
+ unresolved "Build ia32 foo.o"
+ return
+ }
+
+ run_dump_test "abs-iamcu"
+ run_dump_test "iamcu-1"
+ run_dump_test "iamcu-2"
+ run_dump_test "iamcu-3"
+ run_dump_test "iamcu-4"
+}
+
+iamcu_tests
+
run_ld_link_tests $i386tests
run_dump_test "abs"
run_dump_test "protected3"
run_dump_test "protected4"
run_dump_test "protected5"
+run_dump_test "protected6a"
+run_dump_test "protected6b"
run_dump_test "tlspie1"
run_dump_test "tlspie2"
run_dump_test "nogot1"
run_dump_test "lea1f"
run_dump_test "mov1a"
run_dump_test "mov1b"
+run_dump_test "branch1"
+run_dump_test "call1"
+run_dump_test "call2"
+run_dump_test "jmp1"
+run_dump_test "jmp2"
+run_dump_test "load1"
+run_dump_test "load2"
+run_dump_test "load3"
+run_dump_test "load4a"
+run_dump_test "load4b"
+run_dump_test "load5a"
+run_dump_test "load5b"
+run_dump_test "load6"
if { !([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"]
run_dump_test "pr17057"
run_dump_test "pr17935-1"
run_dump_test "pr17935-2"
+run_dump_test "pr18801"
+run_dump_test "pr18815"
+
+# Add $PLT_CFLAGS if PLT is expected.
+global PLT_CFLAGS
# Must be Linux native with the C compiler
if { [isnative]
[list \
"Build libplt-main3.a" \
"" \
- "-fPIC" \
+ "-fPIC $PLT_CFLAGS" \
{ plt-main3.c } \
{{readelf {-Wr} plt-main3.rd}} \
"libplt-main3.a" \
[list \
"Build libplt-main4.a" \
"" \
- "-fPIC" \
+ "-fPIC $PLT_CFLAGS" \
{ plt-main4.c } \
{{readelf {-Wr} plt-main4.rd}} \
"libplt-main4.a" \
{{readelf {-Wr} plt-main.rd}} \
"plt-main" \
] \
+ [list \
+ "Build copyreloc-lib.so" \
+ "-shared" \
+ "-fPIC" \
+ { copyreloc-lib.c } \
+ {} \
+ "copyreloc-lib.so" \
+ ] \
+ [list \
+ "Build copyreloc-main with PIE and GOTOFF (1)" \
+ "tmpdir/copyreloc-lib.so -pie" \
+ "" \
+ { copyreloc-main.S } \
+ {{readelf {-Wr} copyreloc-main1.rd}} \
+ "copyreloc-main" \
+ ] \
+ [list \
+ "Build copyreloc-main with PIE and GOTOFF (2)" \
+ "tmpdir/copyreloc-lib.so -pie" \
+ "" \
+ { copyreloc-main.S } \
+ {{readelf {-Wr} copyreloc-main2.rd}} \
+ "copyreloc-main" \
+ ] \
+ [list \
+ "Build pr17689.so" \
+ "-shared" \
+ "-fPIC" \
+ { pr17689a.c } \
+ {} \
+ "pr17689.so" \
+ ] \
+ [list \
+ "Build pr17689.so with -z now" \
+ "-shared -Wl,-z,now" \
+ "-fPIC" \
+ { pr17689a.c } \
+ {{readelf {-Wr} pr17689now.rd}} \
+ "pr17689now.so" \
+ ] \
+ [list \
+ "Build pr17689ver.so" \
+ "-shared -Wl,--version-script,pr17689a.t" \
+ "-fPIC" \
+ { pr17689a.c } \
+ {} \
+ "pr17689ver.so" \
+ ] \
+ [list \
+ "Build pr17689.a" \
+ "" \
+ "" \
+ { pr17689b.S } \
+ {} \
+ "pr17689.a" \
+ ] \
+ [list \
+ "Build pr17689 with PIE and GOTOFF" \
+ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \
+ "" \
+ { dummy.c } \
+ {{readelf {-Wr} pr17689.rd}} \
+ "pr17689" \
+ ] \
+ [list \
+ "Build pr17689 with PIE, -z now and GOTOFF" \
+ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie -Wl,-z,now" \
+ "" \
+ { dummy.c } \
+ {{readelf {-Wr} pr17689now.rd}} \
+ "pr17689now" \
+ ] \
+ [list \
+ "Build pr17689ver with PIE and GOTOFF" \
+ "tmpdir/pr17689b.o tmpdir/pr17689ver.so -pie" \
+ "" \
+ { dummy.c } \
+ {{readelf {-Wr} pr17689ver.rd}} \
+ "pr17689ver" \
+ ] \
+ [list \
+ "Build pr17827 with PIE and GOTOFF" \
+ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \
+ "" \
+ { dummy.c } \
+ {{readelf {-Wr} pr17827.rd}} \
+ "pr17827" \
+ ] \
+ [list \
+ "Build pr18900.so" \
+ "-shared" \
+ "-fPIC" \
+ { pr18900a.c } \
+ "" \
+ "pr18900.so" \
+ ] \
+ [list \
+ "Build pr18900a" \
+ "tmpdir/pr18900.so" \
+ "" \
+ { pr18900b.c pr18900c.c } \
+ {{readelf {-Wrd} pr18900a.rd}} \
+ "pr18900a" \
+ ] \
+ [list \
+ "Build pr18900b" \
+ "tmpdir/pr18900.so" \
+ "" \
+ { pr18900b.c pr18900c.c } \
+ {{readelf {-Wrd} pr18900b.rd}} \
+ "pr18900b" \
+ ] \
+ [list \
+ "Build pr19031.so" \
+ "-shared" \
+ "-fPIC" \
+ { pr19031a.c } \
+ "" \
+ "pr19031.so" \
+ ] \
+ [list \
+ "Build got1d.so" \
+ "-shared" \
+ "" \
+ { got1d.S } \
+ "" \
+ "got1d.so" \
+ ] \
+ [list \
+ "Build gotpc1" \
+ "tmpdir/got1d.so" \
+ "" \
+ { got1a.S got1b.c got1c.c } \
+ {{objdump {-dw} got1.dd}} \
+ "got1" \
+ ] \
]
run_ld_link_exec_tests [] [list \
"plt-main.out" \
"-fPIC" \
] \
+ [list \
+ "Run copyreloc-main with PIE and GOTOFF" \
+ "tmpdir/copyreloc-lib.so -pie" \
+ "" \
+ { copyreloc-main.S } \
+ "copyreloc-main" \
+ "copyreloc-main.out" \
+ ] \
+ [list \
+ "Run pr17689 with PIE and GOTOFF" \
+ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \
+ "" \
+ { dummy.c } \
+ "pr17689" \
+ "pr17689.out" \
+ ] \
+ [list \
+ "Run pr17689 with PIE, -z now and GOTOFF" \
+ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie -z now" \
+ "" \
+ { dummy.c } \
+ "pr17689now" \
+ "pr17689.out" \
+ ] \
+ [list \
+ "Run pr17689ver with PIE and GOTOFF" \
+ "tmpdir/pr17689b.o tmpdir/pr17689ver.so -pie" \
+ "" \
+ { dummy.c } \
+ "pr17689ver" \
+ "pr17689.out" \
+ ] \
+ [list \
+ "Run pr18900" \
+ "tmpdir/pr18900.so" \
+ "" \
+ { pr18900b.c pr18900c.c } \
+ "pr18900" \
+ "pr18900.out" \
+ ] \
+ [list \
+ "Run pr19031" \
+ "tmpdir/pr19031.so" \
+ "" \
+ { pr19031b.S pr19031c.c } \
+ "pr19031" \
+ "pr19031.out" \
+ ] \
+ [list \
+ "Run got1" \
+ "tmpdir/got1d.so" \
+ "" \
+ { got1a.S got1b.c got1c.c } \
+ "got1" \
+ "got1.out" \
+ ] \
]
}
+
+if { !([istarget "i?86-*-linux*"]
+ || [istarget "x86_64-*-linux*"]) } {
+ return
+}
+
+# Linux only tests
+run_dump_test "pltgot-1"
+run_dump_test "pltgot-2"