mix_pic_and_non_pic [list "arm*-*-*" "aarch64*-*-*"] "" "" "pr19719"
mix_pic_and_non_pic [] "-fPIE" "-pie" "pr19719pie"
-if { ([istarget "i?86-*-*"]
- || [istarget "x86_64-*-*"]) } {
+set AFLAGS_PIE ""
+if { [istarget "i?86-*-*"]
+ || [istarget "x86_64-*-*"] } {
+ set AFLAGS_PIE "-mrelax-relocations=yes"
+}
+
+if { ([istarget "*-*-linux*"]
+ || [istarget "*-*-nacl*"]
+ || [istarget "*-*-gnu*"])
+ && ![istarget "mips*-*-*"] } {
run_ld_link_tests [list \
[list \
"Build libpr23162a.so" \
"Build pr23162a" \
"-pie --no-as-needed tmpdir/libpr23162a.so" \
"" \
- "-mrelax-relocations=yes" \
+ $AFLAGS_PIE \
{ pr23162b.c } \
- {{readelf {--dyn-syms -rW} pr23162.rd}} \
+ {{readelf {-rW} pr23162.rd}} \
"pr23162a" \
"-fPIC -O0" \
] \
"Build pr23162b" \
"-pie --no-as-needed tmpdir/libpr23162b.so" \
"" \
- "-mrelax-relocations=yes" \
+ $AFLAGS_PIE \
{ pr23162b.c } \
- {{readelf {--dyn-syms -rW} pr23162.rd}} \
+ {{readelf {-rW} pr23162.rd}} \
"pr23162b" \
"-fPIC -O0" \
] \
"Build pr23161a" \
"-pie --no-as-needed tmpdir/libpr23161a.so" \
"" \
- "-mrelax-relocations=yes" \
+ $AFLAGS_PIE \
{ pr23161b.c } \
{{readelf {--dyn-syms -rW} pr23161b.rd}} \
"pr23161a" \
"Build pr23161b" \
"-pie --no-as-needed tmpdir/libpr23161b.so" \
"" \
- "-mrelax-relocations=yes" \
+ $AFLAGS_PIE \
{ pr23161b.c } \
{{readelf {--dyn-syms -rW} pr23161b.rd}} \
"pr23161b" \
"-fPIC -O0" \
] \
+ ]
+}
+
+if { [istarget "i?86-*-*"]
+ || [istarget "x86_64-*-*"] } {
+ run_ld_link_tests [list \
[list \
"Build libpr23161c.so" \
"-shared" \
"Build pr23161c" \
"-pie --no-as-needed tmpdir/libpr23161c.so" \
"" \
- "-mrelax-relocations=yes" \
+ $AFLAGS_PIE \
{ pr23161b.c } \
{{readelf {--dyn-syms -rW} pr23161d.rd}} \
"pr23161c" \