"--32" {pr17306b.s} {} ""}
{"PR ld/17306 (2)" "-melf_i386 -shared -Bsymbolic --just-symbols=tmpdir/pr17306b.o" ""
"--32" {pr17306a.s} {} "libpr17306.so"}
+ {"PR ld/17709 (1)" "-melf_i386 -shared" ""
+ "--32" {pr17709a.s} {} "libpr17709.so"}
+ {"PR ld/17709 (2)" "-melf_i386 tmpdir/libpr17709.so" ""
+ "--32" {pr17709b.s} {{readelf -r pr17709.rd}} "pr17709"}
}
# So as to avoid rewriting every last test case here in a nacl variant,
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 "pr17935-1"
run_dump_test "pr17935-2"
+# Add $PLT_CFLAGS if PLT is expected.
+global PLT_CFLAGS
+
# Must be Linux native with the C compiler
if { [isnative]
&& [istarget "i?86-*-linux*"]
[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" \
+ ] \
]
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" \
+ ] \
]
}
+
+if { !([istarget "i?86-*-linux*"]
+ || [istarget "x86_64-*-linux*"]) } {
+ return
+}
+
+# Linux only tests
+run_dump_test "pltgot-1"
+run_dump_test "pltgot-2"