# Expect script for ld-x86_64 tests
-# Copyright (C) 2002-2018 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# Test x86_64 linking; all types of relocs. This tests the assembler and
# tools like objdump as well as the linker.
-if { !([istarget "x86_64-*-elf*"]
- || [istarget "x86_64-*-nacl*"]
- || [istarget "x86_64-*-linux*"]) } {
+if { !([istarget "x86_64-*-elf*"] || [istarget "x86_64-*-linux*"]) } {
return
}
-if [istarget "*-*-nacl*"] {
- set emul "elf_x86_64_nacl"
-} else {
- set emul "elf_x86_64"
-}
-
-global ASFLAGS
+set emul "elf_x86_64"
set saved_ASFLAGS "$ASFLAGS"
set ASFLAGS "$ASFLAGS -mx86-used-note=no"
"--64" { pr19827a.S }}
{"Build pr19827b.so" "-melf_x86_64 -shared" ""
"--64" { pr19827b.S } {} "pr19827b.so"}
- {"Build pr19827" "-melf_x86_64 -pie tmpdir/pr19827a.o tmpdir/pr19827b.so" ""
+ {"Build pr19827"
+ "-melf_x86_64 -pie -z notext tmpdir/pr19827a.o tmpdir/pr19827b.so"
+ ""
"--64" { dummy.s } {{readelf {-rW} pr19827.rd}} "pr19827"}
- {"Build pr19827.so" "-melf_x86_64 -shared -Bsymbolic" ""
+ {"Build pr19827.so"
+ "-melf_x86_64 -shared -Bsymbolic -z notext" ""
"--64" { pr19827a.S } {{readelf {-rW} pr19827.rd}} "pr19827.so"}
{"Build pr19969.so" "-melf_x86_64 -shared" ""
"--64" { pr19969a.S } {} "pr19969.so"}
"--64" { pr20550a.s }}
{"Build pr20550b.so" "-melf_x86_64 -shared" ""
"--64" { pr20550b.s } {} "pr20550b.so"}
- {"Build pr20550" "-melf_x86_64 -pie tmpdir/pr20550a.o tmpdir/pr20550b.so" ""
+ {"Build pr20550"
+ "-melf_x86_64 -pie -z notext tmpdir/pr20550a.o tmpdir/pr20550b.so"
+ ""
"--64" { dummy.s } {} "pr20550"}
}
-# So as to avoid rewriting every last test case here in a nacl variant,
-# we use black magic to massage the generic cases into nacl-variant cases.
-if [istarget "*-*-nacl*"] {
- set emul elf_x86_64_nacl
-
- set lhs {elf(32)?_(i386|x86_64)[[:>:]]}
- set rhs {&_nacl}
-
- # Change all the -melf_x86_64 to -melf_x86_64_nacl so linking can succeed.
- regsub -all -- $lhs $x86_64tests $rhs x86_64tests
-
- set zlhs {-z noseparate-code -z max-page-size=0x200000}
- set zrhs {}
-
- # Remove -z max-page-size=0x200000 -z noseparate-code since they
- # generate different addresses for nacl targets.
- regsub -all -- $zlhs $x86_64tests $zrhs x86_64tests
-
- # Same, applied to all the run_dump_test cases.
- set options_regsub(ld) [list $lhs $rhs]
-
- # The section/segment layout differs too much for the vanilla
- # readelf output files to match. So massage the cases so that
- # they refer to a foo-nacl.rd file instead of a foo.rd file.
- regsub -all -- {([a-z0-9]+)\.rd} $x86_64tests {\1-nacl.rd} x86_64tests
-
- # Likewise for PLTs.
- regsub -all -- {([a-z0-9]+)\.pd} $x86_64tests {\1-nacl.pd} x86_64tests
-} else {
- set emul elf_x86_64
-}
-
run_ld_link_tests $x86_64tests
-global link_output
-global ld
-
set test_name "Mixed x86_64 and i386 input test 1"
set test mixed1
if { ![ld_link $ld tmpdir/$test "-m$emul tmpdir/${test}a.o tmpdir/${test}b.o"] } {
}
run_dump_test "abs"
+run_dump_test "abs-k1om"
run_dump_test "abs-l1om"
run_dump_test "apic"
run_dump_test "pcrel8"
run_dump_test "hidden5"
run_dump_test "protected1"
run_dump_test "protected2"
+run_dump_test "protected2-k1om"
run_dump_test "protected2-l1om"
run_dump_test "protected3"
+run_dump_test "protected3-k1om"
run_dump_test "protected3-l1om"
run_dump_test "protected4"
run_dump_test "protected5"
run_dump_test "pie1"
run_dump_test "pie2"
run_dump_test "pie3"
-run_dump_test "pie3-nacl"
run_dump_test "pic1"
run_dump_test "largecomm-1a"
run_dump_test "largecomm-1b"
run_dump_test "property-x86-4b-x32"
run_dump_test "property-x86-5"
run_dump_test "property-x86-5-x32"
+run_dump_test "property-x86-6"
+run_dump_test "property-x86-6-x32"
run_dump_test "property-x86-ibt1a"
run_dump_test "property-x86-ibt1b"
run_dump_test "property-x86-ibt1a-x32"
run_dump_test "property-x86-shstk4-x32"
run_dump_test "property-x86-shstk5"
run_dump_test "property-x86-shstk5-x32"
+run_dump_test "property-x86-cet1"
+run_dump_test "property-x86-cet1-x32"
+run_dump_test "property-x86-cet2a"
+run_dump_test "property-x86-cet2a-x32"
+run_dump_test "property-x86-cet2b"
+run_dump_test "property-x86-cet2b-x32"
+run_dump_test "property-x86-cet3a"
+run_dump_test "property-x86-cet3a-x32"
+run_dump_test "property-x86-cet3b"
+run_dump_test "property-x86-cet3b-x32"
+run_dump_test "property-x86-cet4a"
+run_dump_test "property-x86-cet4a-x32"
+run_dump_test "property-x86-cet4b"
+run_dump_test "property-x86-cet4b-x32"
+run_dump_test "property-x86-cet5a"
+run_dump_test "property-x86-cet5a-x32"
+run_dump_test "property-x86-cet5b"
+run_dump_test "property-x86-cet5b-x32"
+run_dump_test "property-x86-cet6"
+run_dump_test "property-x86-cet6-x32"
+run_dump_test "property-x86-lam-u48-1a"
+run_dump_test "property-x86-lam-u48-1b"
+run_dump_test "property-x86-lam-u48-2"
+run_dump_test "property-x86-lam-u48-3a"
+run_dump_test "property-x86-lam-u48-3b"
+run_dump_test "property-x86-lam-u48-4"
+run_dump_test "property-x86-lam-u48-5"
+run_dump_test "property-x86-lam-u57-1a"
+run_dump_test "property-x86-lam-u57-1b"
+run_dump_test "property-x86-lam-u57-2"
+run_dump_test "property-x86-lam-u57-3a"
+run_dump_test "property-x86-lam-u57-3b"
+run_dump_test "property-x86-lam-u57-4"
+run_dump_test "property-x86-lam-u57-5"
run_dump_test "pr21884"
-run_dump_test "pr21884-nacl"
run_dump_test "pr22071"
run_dump_test "pr22115-1a"
run_dump_test "pr22115-1a-x32"
run_dump_test "pr23854"
run_dump_test "pr23930"
run_dump_test "pr23930-x32"
+run_dump_test "pr24151a"
+run_dump_test "pr24151a-x32"
+run_dump_test "pr24322a"
+run_dump_test "pr24322a-x32"
+run_dump_test "pr24322b"
+run_dump_test "pr24322b-x32"
+run_dump_test "pr24458a"
+run_dump_test "pr24458a-x32"
+run_dump_test "pr24458b"
+run_dump_test "pr24458b-x32"
+run_dump_test "pr24458c"
+run_dump_test "pr24458c-x32"
+run_dump_test "pr24721"
+run_dump_test "pr24721-x32"
+run_dump_test "pr24905"
+run_dump_test "pr24905-x32"
+run_dump_test "align-branch-1"
+run_dump_test "pr25416-1a"
+run_dump_test "pr25416-2b"
+run_dump_test "pr25416-2a"
+run_dump_test "pr25416-2b"
+run_dump_test "pr25416-3"
+run_dump_test "pr25416-4"
+run_dump_test "pr26018"
+run_dump_test "pr26263"
+run_dump_test "pr26711-1"
+run_dump_test "pr26711-1-x32"
+run_dump_test "pr26711-2"
+run_dump_test "pr26711-2-x32"
+run_dump_test "pr26711-3"
+run_dump_test "pr26711-3-x32"
+run_dump_test "property-x86-isa1"
+run_dump_test "property-x86-isa1-x32"
+run_dump_test "property-x86-isa2"
+run_dump_test "property-x86-isa2-x32"
+run_dump_test "property-x86-isa3"
+run_dump_test "property-x86-isa3-x32"
+run_dump_test "property-x86-isa4"
+run_dump_test "property-x86-isa4-x32"
-if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} {
+if ![istarget "x86_64-*-linux*"] {
return
}
if ![ld_assemble $as "--x32 $srcdir/$subdir/start.s" tmpdir/startx32.o] {
- unresolved "Build ILP32 start.o"
+ fail "Build ILP32 start.o"
return
}
if ![ld_assemble $as "--32 $srcdir/$subdir/start.s" tmpdir/start32.o] {
- unresolved "Build ia32 start.o"
+ fail "Build ia32 start.o"
return
}
if ![ld_assemble $as "--64 $srcdir/$subdir/start.s" tmpdir/start64.o] {
- unresolved "Build LP64 start.o"
+ fail "Build LP64 start.o"
return
}
if ![ld_assemble $as "--x32 $srcdir/$subdir/foo.s" tmpdir/foox32.o] {
- unresolved "Build ILP32 foo.o"
+ fail "Build ILP32 foo.o"
return
}
if ![ld_assemble $as "--32 $srcdir/$subdir/foo.s" tmpdir/foo32.o] {
- unresolved "Build ia32 foo.o"
+ fail "Build ia32 foo.o"
return
}
if ![ld_assemble $as "--64 $srcdir/$subdir/foo.s" tmpdir/foo64.o] {
- unresolved "Build LP64 foo.o"
+ fail "Build LP64 foo.o"
return
}
run_dump_test "ilp32-2"
run_dump_test "ilp32-3"
run_dump_test "ilp32-4"
-run_dump_test "ilp32-4-nacl"
run_dump_test "ilp32-5"
run_dump_test "ilp32-6"
run_dump_test "ilp32-7"
run_dump_test "mov2b"
run_dump_test "mov2c"
run_dump_test "mov2d"
+run_dump_test "ljmp1"
+run_dump_test "ljmp2"
run_dump_test "load1a"
run_dump_test "load1b"
run_dump_test "load1c"
run_dump_test "load1d"
-run_dump_test "load1a-nacl"
-run_dump_test "load1b-nacl"
-run_dump_test "load1c-nacl"
-run_dump_test "load1d-nacl"
run_dump_test "load2"
run_dump_test "call1a"
run_dump_test "call1b"
run_dump_test "pr17935-2"
run_dump_test "pr18160"
run_dump_test "pr18176"
-run_dump_test "pr18801"
+run_dump_test "pr18801a"
+run_dump_test "pr18801b"
+run_dump_test "ifunc-textrel-1a"
+run_dump_test "ifunc-textrel-1b"
+run_dump_test "ifunc-textrel-2a"
+run_dump_test "ifunc-textrel-2b"
run_dump_test "pr18815"
run_dump_test "pr19013"
run_dump_test "pr19013-x32"
-run_dump_test "pr19013-nacl"
run_dump_test "pr19162"
run_dump_test "pr19175"
run_dump_test "pr18591"
run_dump_test "pr19636-2b"
run_dump_test "pr19636-2c"
run_dump_test "pr19636-2d"
-run_dump_test "pr19636-2d-nacl"
run_dump_test "pr19636-2e"
run_dump_test "pr19636-2f"
run_dump_test "pr19636-2g"
run_dump_test "tlsdesc2"
run_dump_test "pr22048"
run_dump_test "pr22929"
+run_dump_test "pr26939"
+run_dump_test "pr26939-x32"
+run_dump_test "pr27016a"
+run_dump_test "pr27016b"
+run_dump_test "report-reloc-1"
+run_dump_test "report-reloc-1-x32"
proc undefined_weak {cflags ldflags} {
set testname "Undefined weak symbol"
}
}
-# Add $PLT_CFLAGS if PLT is expected.
-global PLT_CFLAGS
-# Add $NOPIE_CFLAGS and $NOPIE_LDFLAGS if non-PIE is required.
-global NOPIE_CFLAGS NOPIE_LDFLAGS
-
# Must be native with the C compiler
-if { [isnative] && [which $CC] != 0 } {
- run_cc_link_tests {
- {"Helper X32 DSO from x86-64 object" "" "-m64 -fPIC -g"
- {simple.c} {} "libsimple.a"}
- }
+if { [isnative] && [check_compiler_available] } {
+ run_cc_link_tests [list \
+ [list \
+ "Helper X32 DSO from x86-64 object" "" \
+ "-m64 $NOSANITIZE_CFLAGS -fPIC -g" \
+ {simple.c} {} "libsimple.a" \
+ ] \
+ ]
set convertx32 "$objcopy -O elf32-x86-64 tmpdir/simple.o tmpdir/simple-x32.o"
send_log "$convertx32\n"
return
}
- run_ld_link_tests {
- {"X32 DSO from x86-64 object"
- "-shared -melf32_x86_64 tmpdir/simple-x32.o" ""
- "--x32 -mx86-used-note=yes"
- {dummy.s} {{readelf {-s --wide} x86-64-x32.rd}} "x86-64-x32"}
- }
+ run_ld_link_tests [list \
+ [list \
+ "X32 DSO from x86-64 object" \
+ "-shared -melf32_x86_64 tmpdir/simple-x32.o" \
+ "$NOSANITIZE_CFLAGS" \
+ "--x32 -mx86-used-note=yes" \
+ {dummy.s} {{readelf {-s --wide} x86-64-x32.rd}} \
+ "x86-64-x32" \
+ ] \
+ ]
run_cc_link_tests [list \
[list \
{{objdump {-dw} pr19319.dd}} \
"pr19319" \
] \
+ [list \
+ "Build pr24276.so" \
+ "-shared -nostdlib -nostartfiles \
+ -Ltmpdir $srcdir/$subdir/pr24276.dso" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr19319b.S } \
+ {{warning_output pr24276.warn}} \
+ "pr24276.so" \
+ ] \
[list \
"Build property 1" \
"" \
] \
[list \
"Build pr22001-1a" \
- "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+ "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \
"$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
{ pr22001-1b.c } \
{{error_output "pr22001-1a.err"}} \
] \
[list \
"Build pr21997-1a" \
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \
"$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
{ pr21997-1b.c } \
{{error_output "pr21997-1a.err"}} \
] \
[list \
"Build pr22791-1" \
- "-pie -Wl,--no-as-needed tmpdir/pr22791-1.so" \
+ "-pie -Wl,--no-as-needed,-z,notext tmpdir/pr22791-1.so" \
"$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
{ pr22791-1b.s } \
{{error_output "pr22791-1.err"}} \
]
if {[istarget "x86_64-*-linux*-gnux32"]} {
+ run_cc_link_tests [list \
+ [list \
+ "Build pr25416-5b.o (GDesc -maddress-mode=short)" \
+ "" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr25416-5b.s } \
+ ] \
+ [list \
+ "Build pr25416-5b.so (GDesc -> IE -maddress-mode=short)" \
+ "-shared" \
+ "-fPIC -Wa,-mx86-used-note=yes" \
+ { pr25416-5b.s pr25416-5d.s } \
+ {} \
+ "pr25416-5b.so" \
+ ] \
+ [list \
+ "Build pr25416-5c.o (GDesc -maddress-mode=long)" \
+ "" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr25416-5c.s } \
+ ] \
+ [list \
+ "Build pr25416-5c.so (GDesc -> IE -maddress-mode=long)" \
+ "-shared" \
+ "-fPIC -Wa,-mx86-used-note=yes" \
+ { pr25416-5c.s pr25416-5d.s } \
+ {} \
+ "pr25416-5c.so" \
+ ] \
+ [list \
+ "Build pr25416-5d.so (GDesc -maddress-mode=short)" \
+ "-shared" \
+ "-fPIC -Wa,-mx86-used-note=yes" \
+ { pr25416-5b.s pr25416-5e.s } \
+ {} \
+ "pr25416-5d.so" \
+ ] \
+ [list \
+ "Build pr25416-5d.o (IE -maddress-mode=short)" \
+ "" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr25416-5d.s } \
+ ] \
+ ]
+
run_ld_link_exec_tests [list \
[list \
"Run pr22001-1b" \
- "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+ "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \
"-Wa,-mx86-used-note=yes" \
{ pr22001-1c.c } \
"pr22001-1b" \
] \
[list \
"Run pr21997-1b" \
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \
"-Wa,-mx86-used-note=yes" \
{ pr21997-1c.c } \
"pr21997-1b" \
"pass.out" \
"$NOPIE_CFLAGS" \
] \
+ [list \
+ "Run pr25416-5a (GDesc -> IE -maddress-mode=short)" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr25416-5b.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr25416-5a.c } \
+ "pr25416-5a" \
+ "pass.out" \
+ "$NOPIE_CFLAGS" \
+ ] \
+ [list \
+ "Run pr25416-5b (GDesc -> LE -maddress-mode=short" \
+ "$NOPIE_LDFLAGS tmpdir/pr25416-5b.o tmpdir/pr25416-5d.o" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr25416-5a.c } \
+ "pr25416-5b" \
+ "pass.out" \
+ "$NOPIE_CFLAGS" \
+ ] \
+ [list \
+ "Run pr25416-5c (GDesc -> IE -maddress-mode=long)" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr25416-5c.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr25416-5a.c } \
+ "pr25416-5c" \
+ "pass.out" \
+ "$NOPIE_CFLAGS" \
+ ] \
+ [list \
+ "Run pr25416-5d (GDesc -> LE -maddress-mode=long)" \
+ "$NOPIE_LDFLAGS tmpdir/pr25416-5c.o tmpdir/pr25416-5d.o" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr25416-5a.c } \
+ "pr25416-5d" \
+ "pass.out" \
+ "$NOPIE_CFLAGS" \
+ ] \
+ [list \
+ "Run pr25416-5e (GDesc -maddress-mode=short)" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr25416-5d.so" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr25416-5a.c } \
+ "pr25416-5e" \
+ "pass.out" \
+ "$NOPIE_CFLAGS" \
+ ] \
+ [list \
+ "Run pr25416-5f (PIE GDesc -> LE -maddress-mode=short)" \
+ "-pie -Wl,-z,notext tmpdir/pr25416-5b.o tmpdir/pr25416-5d.o" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr25416-5a.c } \
+ "pr25416-5f" \
+ "pass.out" \
+ ] \
+ [list \
+ "Run pr25416-5g (PIE GDesc -> LE -maddress-mode=long)" \
+ "-pie -Wl,-z,notext tmpdir/pr25416-5c.o tmpdir/pr25416-5d.o" \
+ "-Wa,-mx86-used-note=yes" \
+ { pr25416-5a.c } \
+ "pr25416-5g" \
+ "pass.out" \
+ ] \
]
} else {
run_cc_link_tests [list \
[list \
"Build pr22001-1b" \
- "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
+ "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \
"$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
{ pr22001-1c.c } \
{{error_output "pr22001-1b.err"}} \
] \
[list \
"Build pr21997-1b" \
- "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \
+ "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \
"$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \
{ pr21997-1c.c } \
{{error_output "pr21997-1b.err"}} \
"pr21997-1b" \
] \
+ [list \
+ "Build lam-u48.so" \
+ "-shared -Wl,-z,lam-u48" \
+ "" \
+ {dummy.s} \
+ {{readelf -n lam-u48.rd}} \
+ "lam-u48.so" \
+ ] \
+ [list \
+ "Build lam-u57.so" \
+ "-shared -Wl,-z,lam-u57" \
+ "" \
+ {dummy.s} \
+ {{readelf -n lam-u57.rd}} \
+ "lam-u57.so" \
+ ] \
]
}
{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" \
- ] \
[list \
"Run pr22001-1a (PIC 1)" \
"$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
"$NOPIE_CFLAGS" \
] \
[list \
- "Build pr22842" \
+ "Run pr22842" \
"-pie -Wl,--no-as-needed tmpdir/pr22842.so" \
"-Wa,-mx86-used-note=yes" \
{ pr22842b.S } \
"pr22842" \
"pass.out" \
] \
+ [list \
+ "Run pr23997" \
+ "" \
+ "" \
+ { pr23997a.s pr23997b.c pr23997c.c } \
+ "pr23997" \
+ "pass.out" \
+ ] \
]
# Run-time tests which require working ifunc attribute support.
"tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
tmpdir/plt-main4.o tmpdir/libplt-lib.so -z bndplt \
-z noseparate-code -z max-page-size=0x200000" \
- "-Wa,-mx86-used-note=yes" \
+ "-Wa,-mx86-used-note=yes $NOCF_PROTECTION_CFLAGS" \
{ plt-main5.c } \
{{objdump {-drw} plt-main-bnd.dd}} \
"plt-main-bnd" \
"tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
tmpdir/plt-main4.o tmpdir/libplt-lib.so -z bndplt -pie \
-z noseparate-code -z max-page-size=0x200000" \
- "-fPIC -Wa,-mx86-used-note=yes" \
+ "-fPIC -Wa,-mx86-used-note=yes $NOCF_PROTECTION_CFLAGS" \
{ plt-main5.c } \
{{objdump {-drw} plt-main-bnd.dd}} \
"plt-main-pie-bnd" \
"tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
tmpdir/plt-main4.o tmpdir/libplt-lib.so -z bndplt -z now \
-z noseparate-code -z max-page-size=0x200000" \
- "-Wa,-mx86-used-note=yes" \
+ "-Wa,-mx86-used-note=yes $NOCF_PROTECTION_CFLAGS" \
{ plt-main5.c } \
{{readelf {-SW} plt-main-bnd-now.rd} {objdump {-drw} plt-main-bnd.dd}} \
"plt-main-bnd-now" \
"tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \
tmpdir/plt-main4.o tmpdir/libplt-lib.so -z bndplt -z now -pie \
-z noseparate-code -z max-page-size=0x200000" \
- "-fPIC -Wa,-mx86-used-note=yes" \
+ "-fPIC -Wa,-mx86-used-note=yes $NOCF_PROTECTION_CFLAGS" \
{ plt-main5.c } \
{{readelf {-SW} plt-main-bnd-now.rd} {objdump {-drw} plt-main-bnd.dd}} \
"plt-main-pie-bnd-now" \
]
# Linux only tests
-global LD_CLASS
if { "$LD_CLASS" == "64bit" } then {
# This test needs 64-bit linker.
run_dump_test "pr17618"