diff options
Diffstat (limited to 'ld/testsuite/ld-elf')
61 files changed, 269 insertions, 90 deletions
diff --git a/ld/testsuite/ld-elf/binutils.exp b/ld/testsuite/ld-elf/binutils.exp index 578b639..4fd2eab 100644 --- a/ld/testsuite/ld-elf/binutils.exp +++ b/ld/testsuite/ld-elf/binutils.exp @@ -25,7 +25,6 @@ if { !([istarget *-*-linux*] || [istarget arm*-*-uclinuxfdpiceabi] - || [istarget *-*-nacl*] || [istarget *-*-gnu*]) || [istarget *ecoff] } then { return } diff --git a/ld/testsuite/ld-elf/build-id.exp b/ld/testsuite/ld-elf/build-id.exp index 3c83743..1b97e24 100644 --- a/ld/testsuite/ld-elf/build-id.exp +++ b/ld/testsuite/ld-elf/build-id.exp @@ -31,7 +31,6 @@ if { [istarget frv-*-*] || [istarget lm32-*-*] } { if { !([istarget *-*-linux*] || [istarget arm*-*-uclinuxfdpiceabi] - || [istarget *-*-nacl*] || [istarget *-*-gnu*]) } then { return } diff --git a/ld/testsuite/ld-elf/dwarf.exp b/ld/testsuite/ld-elf/dwarf.exp index c7b2915..4f79635 100644 --- a/ld/testsuite/ld-elf/dwarf.exp +++ b/ld/testsuite/ld-elf/dwarf.exp @@ -69,11 +69,11 @@ set run_tests { } # Disable all sanitizers. -set old_CFLAGS "$CFLAGS_FOR_TARGET" -append CFLAGS_FOR_TARGET " $NOSANITIZE_CFLAGS" +set old_CFLAGS "$CFLAGS_FOR_TARGET_TEST" +append CFLAGS_FOR_TARGET_TEST " $NOSANITIZE_CFLAGS" run_cc_link_tests $build_tests run_ld_link_exec_tests $run_tests -set CFLAGS_FOR_TARGET "$old_CFLAGS" +set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" proc strip_test {} { global ld diff --git a/ld/testsuite/ld-elf/eh-group.exp b/ld/testsuite/ld-elf/eh-group.exp index 1656c2e..c157141 100644 --- a/ld/testsuite/ld-elf/eh-group.exp +++ b/ld/testsuite/ld-elf/eh-group.exp @@ -40,6 +40,11 @@ if ![is_elf_format] { return } +set as_gsframe "" +if { [gas_sframe_check] } { + set as_gsframe "--gsframe" +} + # alpha-linux-gnu does not support 64-bit relocations: # relocation truncated to fit: REFLONG against `.gcc_except_table' # arm-eabi does not support 64-bit relocations: @@ -58,7 +63,7 @@ if [is_elf64 "tmpdir/eh-group1size.o"] { set build_tests_ld [list \ [list "Build eh-group1.o" \ - "-r" "" "$as_options" \ + "-r" "" "$as_options $as_gsframe" \ {eh-group1.s eh-group2.s} {} "eh-group.o"] \ ] diff --git a/ld/testsuite/ld-elf/ehdr_start-missing.d b/ld/testsuite/ld-elf/ehdr_start-missing.d index 3fb85e0..2374696 100644 --- a/ld/testsuite/ld-elf/ehdr_start-missing.d +++ b/ld/testsuite/ld-elf/ehdr_start-missing.d @@ -1,5 +1,5 @@ #source: ehdr_start-strongref.s #ld: -e _start -T ehdr_start-missing.t --no-dynamic-linker #error: .*: undefined reference to `__ehdr_start' -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: bfin-*-* diff --git a/ld/testsuite/ld-elf/ehdr_start-shared.d b/ld/testsuite/ld-elf/ehdr_start-shared.d index a2a4dcc..319cd93 100644 --- a/ld/testsuite/ld-elf/ehdr_start-shared.d +++ b/ld/testsuite/ld-elf/ehdr_start-shared.d @@ -1,7 +1,7 @@ #source: ehdr_start.s #ld: -e _start -shared -z notext #nm: -n -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: bfin-*-* cris*-*-* frv-*-* lm32-*-* ![check_shared_lib_support] #... diff --git a/ld/testsuite/ld-elf/ehdr_start-userdef.d b/ld/testsuite/ld-elf/ehdr_start-userdef.d index 93ed0d8..b41436e 100644 --- a/ld/testsuite/ld-elf/ehdr_start-userdef.d +++ b/ld/testsuite/ld-elf/ehdr_start-userdef.d @@ -1,7 +1,7 @@ #source: ehdr_start-strongref.s #ld: -e _start -T ehdr_start-userdef.t #readelf: -Ws -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: bfin-*-* frv-*-* #... diff --git a/ld/testsuite/ld-elf/ehdr_start-weak.d b/ld/testsuite/ld-elf/ehdr_start-weak.d index c4f9072..d77a464 100644 --- a/ld/testsuite/ld-elf/ehdr_start-weak.d +++ b/ld/testsuite/ld-elf/ehdr_start-weak.d @@ -1,7 +1,7 @@ #source: ehdr_start.s #ld: -e _start -T ehdr_start-missing.t --no-dynamic-linker #nm: -n -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: bfin-*-* frv-*-* #failif diff --git a/ld/testsuite/ld-elf/ehdr_start.d b/ld/testsuite/ld-elf/ehdr_start.d index 0ec3b13..2e9a2fa 100644 --- a/ld/testsuite/ld-elf/ehdr_start.d +++ b/ld/testsuite/ld-elf/ehdr_start.d @@ -1,7 +1,7 @@ #source: ehdr_start.s #ld: -e _start --build-id #nm: -n -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: bfin-*-* frv-*-* lm32-*-* #... diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp index 7e69940..098e712 100644 --- a/ld/testsuite/ld-elf/elf.exp +++ b/ld/testsuite/ld-elf/elf.exp @@ -86,6 +86,9 @@ run_ld_link_tests [list \ if [is_elf64 tmpdir/symbol3w.a] { set ASFLAGS "$ASFLAGS --defsym ALIGN=3" + if { [istarget powerpc*-*-linux*] } { + set LDFLAGS "$LDFLAGS --no-ld-generated-unwind-info" + } set pr23900_1_exp "pr23900-1-64.rd" set pr25490_2_exp "pr25490-2-64.rd" set pr25490_3_exp "pr25490-3-64.rd" @@ -229,7 +232,6 @@ proc target_defaults_to_execstack {} { } if { [istarget *-*-*linux*] - || [istarget *-*-nacl*] || [istarget *-*-gnu*] } { run_ld_link_tests [list \ [list "stack exec" \ @@ -286,6 +288,13 @@ if { [istarget *-*-*linux*] {pr29072-a.s} \ {{ld pr29072.a.warn}} \ "pr29072-a.exe"] \ + [list "Test --error-execstack with an executable .note.GNU-stack" \ + "--warn-execstack --error-execstack" \ + "" \ + "" \ + {pr29072-a.s} \ + {{ld gnu_execstack.err}} \ + "gnu_execstack.exe"] \ [list "PR 29072 (warn about -z execstack)" \ "-z execstack --warn-execstack --no-error-execstack" \ "" \ @@ -293,6 +302,13 @@ if { [istarget *-*-*linux*] {stack.s} \ {{ld pr29072.c.warn}} \ "pr29072-c.exe"] \ + [list "Test --error-execstack with -z execstack" \ + "-z execstack --warn-execstack --error-execstack" \ + "" \ + "" \ + {stack.s} \ + {{ld z_execstack.err}} \ + "execstack.exe"] \ [list "PR ld/29072 (suppress warnings about executable stack)" \ "-e 0 --no-warn-execstack" \ "" \ @@ -300,13 +316,20 @@ if { [istarget *-*-*linux*] {pr29072-a.s} \ {} \ "pr29072-d.exe"] \ - [list "Ensure that a warning issued when creating a segment with RWX permissions" \ + [list "Ensure that a warning is issued when creating a segment with RWX permissions" \ "-e 0 -Tnobits-1.t --warn-rwx-segments --no-error-rwx-segments" \ "" \ "" \ {nobits-1.s} \ {{ld rwx-segments-1.l}} \ "rwx-segments-1.exe"] \ + [list "Ensure that a error can be issued when creating a segment with RWX permissions" \ + "-e 0 -Tnobits-1.t --warn-rwx-segments --error-rwx-segments" \ + "" \ + "" \ + {nobits-1.s} \ + {{ld rwx-segments-3.err}} \ + "rwx-segments-3.exe"] \ [list "Ensure that a warning issued when creating a TLS segment with execute permission" \ "-e 0 -T rwx-segments-2.t --warn-rwx-segments --no-error-rwx-segments" \ "" \ @@ -314,6 +337,13 @@ if { [istarget *-*-*linux*] {size-2.s} \ {{ld rwx-segments-2.l}} \ "rwx-segments-2.exe"] \ + [list "Ensure that an error cn be issued when creating a TLS segment with execute permission" \ + "-e 0 -T rwx-segments-2.t --warn-rwx-segments --error-rwx-segments" \ + "" \ + "" \ + {size-2.s} \ + {{ld rwx-segments-4.err}} \ + "rwx-segments-4.exe"] \ [list "Ensure that the RWX warning can be suppressed" \ "-e 0 -Tnobits-1.t --no-warn-rwx-segments" \ "" \ @@ -335,6 +365,16 @@ if { [istarget *-*-*linux*] {{ld pr29072.b.warn}} \ "pr29072-b.exe"] \ ] + + run_ld_link_tests [list \ + [list "error when .note.GNU-stack is absent" \ + "-e 0 -z stack-size=0x123400 --warn-execstack --error-execstack" \ + "" \ + "" \ + {pr29072-b.s} \ + {{ld missing-execstack.err}} \ + "missing-execstack.exe"] \ + ] } else { run_ld_link_tests [list \ [list "PR ld/29072 (ignore absent .note.GNU-stack)" \ @@ -445,7 +485,6 @@ set xfails "*-*-netbsd*" run_ld_link_exec_tests $array_tests $xfails if { [istarget *-*-linux*] - || [istarget *-*-nacl*] || [istarget *-*-gnu*] } { run_ld_link_exec_tests $array_tests_pie $xfails diff --git a/ld/testsuite/ld-elf/export-class.exp b/ld/testsuite/ld-elf/export-class.exp index 7a84755..f4a0634 100644 --- a/ld/testsuite/ld-elf/export-class.exp +++ b/ld/testsuite/ld-elf/export-class.exp @@ -33,7 +33,6 @@ if { ![is_elf_format] || ![check_shared_lib_support] } { # if you like. if { ![istarget *-*-linux*] && ![istarget arm*-*-uclinuxfdpiceabi] - && ![istarget *-*-nacl*] && ![istarget *-*-gnu*] } { return } diff --git a/ld/testsuite/ld-elf/fatal-warnings-1a.d b/ld/testsuite/ld-elf/fatal-warnings-1a.d index 7afee53..a8632ba 100644 --- a/ld/testsuite/ld-elf/fatal-warnings-1a.d +++ b/ld/testsuite/ld-elf/fatal-warnings-1a.d @@ -3,4 +3,4 @@ #ld: --no-dynamic-linker --fatal-warnings -z dynamic-undefined-weak #readelf: -r -x .data.rel.ro #error: unsupported option: -z dynamic-undefined-weak -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi diff --git a/ld/testsuite/ld-elf/fatal-warnings-1b.d b/ld/testsuite/ld-elf/fatal-warnings-1b.d index 70862b2..34aaf10 100644 --- a/ld/testsuite/ld-elf/fatal-warnings-1b.d +++ b/ld/testsuite/ld-elf/fatal-warnings-1b.d @@ -3,4 +3,4 @@ #ld: --no-dynamic-linker -z dynamic-undefined-weak --fatal-warnings #readelf: -r -x .data.rel.ro #error: unsupported option: -z dynamic-undefined-weak -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi diff --git a/ld/testsuite/ld-elf/gnu_execstack.err b/ld/testsuite/ld-elf/gnu_execstack.err new file mode 100644 index 0000000..be70b63 --- /dev/null +++ b/ld/testsuite/ld-elf/gnu_execstack.err @@ -0,0 +1,3 @@ +#... +.*: error: .*: is triggering the generation of an executable stack \(because it has an executable .note.GNU-stack section\) +#... diff --git a/ld/testsuite/ld-elf/indirect.exp b/ld/testsuite/ld-elf/indirect.exp index 9a0bcb2..3d9cc2a 100644 --- a/ld/testsuite/ld-elf/indirect.exp +++ b/ld/testsuite/ld-elf/indirect.exp @@ -189,14 +189,21 @@ set run_tests [list \ {check-ptr-eq.c} "pr18720d" "pr18720.out"] \ [list "Run with libpr19553b.so" \ "-Wl,--no-as-needed tmpdir/libpr19553b.so tmpdir/libpr19553d.so -Wl,-rpath-link,." "" \ - {pr19553a.c} "pr19553b" "pr19553b.out"] \ + {pr19553a.c} "pr19553b" "pr19553b.out"] +] + +# This test relies on versioned symbols, which Solaris ld.so.1 doesn't support. +if { ![istarget *-*-solaris2*] } { + lappend run_tests \ [list "Run with libpr19553c.so" \ "-Wl,--no-as-needed tmpdir/libpr19553c.so tmpdir/libpr19553b.so tmpdir/libpr19553d.so" "" \ - {pr19553a.c} "pr19553c" "pr19553c.out"] \ + {pr19553a.c} "pr19553c" "pr19553c.out"] +} + +lappend run_tests \ [list "Run with libpr19553d.so" \ "-Wl,--no-as-needed tmpdir/libpr19553d.so tmpdir/libpr19553b.so -Wl,-rpath-link,." "" \ - {pr19553a.c} "pr19553d" "pr19553d.out"] \ -] + {pr19553a.c} "pr19553d" "pr19553d.out"] run_ld_link_exec_tests $run_tests diff --git a/ld/testsuite/ld-elf/linkonce1.d b/ld/testsuite/ld-elf/linkonce1.d index e4f9a70..3920f25 100644 --- a/ld/testsuite/ld-elf/linkonce1.d +++ b/ld/testsuite/ld-elf/linkonce1.d @@ -2,11 +2,10 @@ #source: linkonce1b.s #ld: -r #objdump: -r +#notarget: [is_generic] .*: file format .* #... -RELOCATION RECORDS FOR \[.debug_frame\]: -OFFSET[ ]+TYPE[ ]+VALUE[ ]* -.*(NONE|unused|UNUSED).*\*ABS\* +RELOCATION RECORDS FOR \[.debug_frame\]: \(none\) #pass diff --git a/ld/testsuite/ld-elf/linkonce3.d b/ld/testsuite/ld-elf/linkonce3.d new file mode 100644 index 0000000..25306d2 --- /dev/null +++ b/ld/testsuite/ld-elf/linkonce3.d @@ -0,0 +1,13 @@ +#source: linkonce1a.s +#source: linkonce1b.s +#ld: -r +#objdump: -r +#target: [is_generic] + +.*: file format .* +#... +RELOCATION RECORDS FOR \[.debug_frame\]: +OFFSET[ ]+TYPE[ ]+VALUE[ ]* +.*(NONE|unused|UNUSED).*\*ABS\* + +#pass diff --git a/ld/testsuite/ld-elf/linux-x86.exp b/ld/testsuite/ld-elf/linux-x86.exp index 27173b9..a4dfc8a 100644 --- a/ld/testsuite/ld-elf/linux-x86.exp +++ b/ld/testsuite/ld-elf/linux-x86.exp @@ -84,9 +84,9 @@ run_cc_link_tests [list \ ] \ [list \ "Build indirect-extern-access-1a without PIE" \ - "$NOPIE_LDFLAGS -Wl,--no-as-needed -z noexecstack \ + "$NOPIE_LDFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS -Wl,--no-as-needed -z noexecstack \ tmpdir/indirect-extern-access-1.so" \ - "$NOPIE_CFLAGS" \ + "$NOPIE_CFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS" \ { indirect-extern-access.S indirect-extern-access-1b.c } \ {{readelf -rn indirect-extern-access-1.rd}} \ "indirect-extern-access-1a" \ @@ -101,9 +101,9 @@ run_cc_link_tests [list \ ] \ [list \ "Build indirect-extern-access-2a without PIE" \ - "$NOPIE_LDFLAGS -Wl,--no-as-needed -z noexecstack \ + "$NOPIE_LDFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS -Wl,--no-as-needed -z noexecstack \ tmpdir/indirect-extern-access-2.so" \ - "$NOPIE_CFLAGS" \ + "$NOPIE_CFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS" \ { indirect-extern-access.S indirect-extern-access-1b.c } \ {{readelf -rn indirect-extern-access-2.rd}} \ "indirect-extern-access-2a" \ @@ -375,11 +375,11 @@ proc check_pr25749a {testname srcfilea srcfileb cflags ldflags lderror} { check_pr25749a "pr25749-1a" "pr25749-1.c" "pr25749-1a.c" "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" "" check_pr25749a "pr25749-1a" "pr25749-1.c" "pr25749-1a.c" "-fPIE" "-pie" "" -check_pr25749a "pr25749-1b" "pr25749-1.c" "pr25749-1b.c" "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" "" +check_pr25749a "pr25749-1b" "pr25749-1.c" "pr25749-1b.c" "$NOPIE_CFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS" "$NOPIE_LDFLAGS" "" if { [istarget "i?86-*-linux*"] || ![at_least_gcc_version 5 1] } { - check_pr25749a "pr25749-1b" "pr25749-1.c" "pr25749-1b.c" "-fPIE" "-pie" "" + check_pr25749a "pr25749-1b" "pr25749-1.c" "pr25749-1b.c" "-fPIE $DIRECT_EXTERN_ACCESS_CFLAGS" "-pie" "" } else { - check_pr25749a "pr25749-1b" "pr25749-1.c" "pr25749-1b.c" "-fPIE" "-pie" "pr25749-1b.err" + check_pr25749a "pr25749-1b" "pr25749-1.c" "pr25749-1b.c" "-fPIE $DIRECT_EXTERN_ACCESS_CFLAGS" "-pie" "pr25749-1b.err" } check_pr25749a "pr25749-1c" "pr25749-1.c" "pr25749-1c.c" "-fPIC" "-shared" "pr25749-1b.err" check_pr25749a "pr25749-2a" "pr25749-2.c" "pr25749-2a.s" "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" "" diff --git a/ld/testsuite/ld-elf/missing-execstack.err b/ld/testsuite/ld-elf/missing-execstack.err new file mode 100644 index 0000000..9549cf5 --- /dev/null +++ b/ld/testsuite/ld-elf/missing-execstack.err @@ -0,0 +1,3 @@ +#... +.*: error: .*\.o: is triggering the generation of an executable stack because it does not have a .note.GNU-stack section +#... diff --git a/ld/testsuite/ld-elf/no-section-header.exp b/ld/testsuite/ld-elf/no-section-header.exp index 2a4575b..7461fdd 100644 --- a/ld/testsuite/ld-elf/no-section-header.exp +++ b/ld/testsuite/ld-elf/no-section-header.exp @@ -21,7 +21,7 @@ # Written by H.J. Lu (hongjiu.lu@intel.com) # -if { ![is_elf_format] } { +if { ![istarget *-*-gnu*] } { return } diff --git a/ld/testsuite/ld-elf/orphan-region.d b/ld/testsuite/ld-elf/orphan-region.d index 3f5bfd7..ef21ec3 100644 --- a/ld/testsuite/ld-elf/orphan-region.d +++ b/ld/testsuite/ld-elf/orphan-region.d @@ -1,9 +1,9 @@ #source: orphan-region.s #ld: -T orphan-region.ld -N -z stack-size=0 --no-warn-rwx-segments #readelf: -S -l --wide -#xfail: [uses_genelf] hppa*64*-*-* spu-*-* *-*-nacl* +#xfail: [uses_genelf] hppa*64*-*-* spu-*-* # if not using elf.em, you don't get fancy orphan handling -# spu twiddles LOAD range, hppa64 adds PHDR, nacl splits to two segments +# spu twiddles LOAD range, hppa64 adds PHDR #... \[[ 0-9]+\] \.text[ \t]+PROGBITS[ \t]+0*40000000[ \t]+.* diff --git a/ld/testsuite/ld-elf/package-note.exp b/ld/testsuite/ld-elf/package-note.exp index 5ad3cf5..7249cb7 100644 --- a/ld/testsuite/ld-elf/package-note.exp +++ b/ld/testsuite/ld-elf/package-note.exp @@ -27,7 +27,6 @@ if ![is_elf_format] { if { !([istarget *-*-linux*] || [istarget arm*-*-uclinuxfdpiceabi] - || [istarget *-*-nacl*] || [istarget *-*-gnu*]) } then { return } diff --git a/ld/testsuite/ld-elf/pr16322.d b/ld/testsuite/ld-elf/pr16322.d index 1e9175c..914d631 100644 --- a/ld/testsuite/ld-elf/pr16322.d +++ b/ld/testsuite/ld-elf/pr16322.d @@ -1,6 +1,6 @@ #ld: -shared -z relro -z noseparate-code #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #xfail: ![check_relro_support] diff --git a/ld/testsuite/ld-elf/pr16498a.d b/ld/testsuite/ld-elf/pr16498a.d index de68389..8690aaf 100644 --- a/ld/testsuite/ld-elf/pr16498a.d +++ b/ld/testsuite/ld-elf/pr16498a.d @@ -1,6 +1,6 @@ #ld: -shared -T pr16498a.t #readelf: -l --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #... diff --git a/ld/testsuite/ld-elf/pr16498b.d b/ld/testsuite/ld-elf/pr16498b.d index aceb307..433e281 100644 --- a/ld/testsuite/ld-elf/pr16498b.d +++ b/ld/testsuite/ld-elf/pr16498b.d @@ -1,7 +1,7 @@ #source: pr16498a.s #ld: -shared -T pr16498b.t #readelf: -l --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #... diff --git a/ld/testsuite/ld-elf/pr19162.d b/ld/testsuite/ld-elf/pr19162.d index 1e7c1a9..bb5af3b 100644 --- a/ld/testsuite/ld-elf/pr19162.d +++ b/ld/testsuite/ld-elf/pr19162.d @@ -2,7 +2,7 @@ #source: pr19162b.s #ld: -shared -z max-page-size=0x200000 -z noseparate-code #readelf: -l --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: hppa*-*-* ![check_shared_lib_support] # hppa fails due to PR 12376. diff --git a/ld/testsuite/ld-elf/pr22269a.d b/ld/testsuite/ld-elf/pr22269a.d index 8644d0e..a4af8fe 100644 --- a/ld/testsuite/ld-elf/pr22269a.d +++ b/ld/testsuite/ld-elf/pr22269a.d @@ -2,7 +2,7 @@ #source: pr22269.s #ld: -pie --no-dynamic-linker #readelf: -r -x .data.rel.ro -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi # The BFIN target always generates a relocation. #xfail: ![check_pie_support] || bfin-*-* diff --git a/ld/testsuite/ld-elf/pr22269b.d b/ld/testsuite/ld-elf/pr22269b.d index 1d8e7bd..f3cedc4 100644 --- a/ld/testsuite/ld-elf/pr22269b.d +++ b/ld/testsuite/ld-elf/pr22269b.d @@ -3,7 +3,7 @@ #ld: -pie --no-dynamic-linker -z dynamic-undefined-weak #readelf: -r -x .data.rel.ro #warning: -z dynamic-undefined-weak ignored -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi # The BFIN target always generates a relocation. #xfail: ![check_pie_support] || bfin-*-* diff --git a/ld/testsuite/ld-elf/pr22393-1a.d b/ld/testsuite/ld-elf/pr22393-1a.d index 2bfa403..c832cc1 100644 --- a/ld/testsuite/ld-elf/pr22393-1a.d +++ b/ld/testsuite/ld-elf/pr22393-1a.d @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -shared -z separate-code -z relro #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #xfail: ![check_relro_support] diff --git a/ld/testsuite/ld-elf/pr22393-1b.d b/ld/testsuite/ld-elf/pr22393-1b.d index 96d8bc0..f624014 100644 --- a/ld/testsuite/ld-elf/pr22393-1b.d +++ b/ld/testsuite/ld-elf/pr22393-1b.d @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -shared -z relro -z separate-code #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #xfail: ![check_relro_support] diff --git a/ld/testsuite/ld-elf/pr22393-1c.d b/ld/testsuite/ld-elf/pr22393-1c.d index c34dab3..648200d 100644 --- a/ld/testsuite/ld-elf/pr22393-1c.d +++ b/ld/testsuite/ld-elf/pr22393-1c.d @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -pie -z separate-code #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_pie_support] #failif diff --git a/ld/testsuite/ld-elf/pr22393-1d.d b/ld/testsuite/ld-elf/pr22393-1d.d index 4723e53..1191883 100644 --- a/ld/testsuite/ld-elf/pr22393-1d.d +++ b/ld/testsuite/ld-elf/pr22393-1d.d @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -pie -z separate-code #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_pie_support] #failif diff --git a/ld/testsuite/ld-elf/pr22393-1e.d b/ld/testsuite/ld-elf/pr22393-1e.d index 55f7e9a..3f3516b 100644 --- a/ld/testsuite/ld-elf/pr22393-1e.d +++ b/ld/testsuite/ld-elf/pr22393-1e.d @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -z separate-code #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: rx-*-linux* #failif diff --git a/ld/testsuite/ld-elf/pr22393-1f.d b/ld/testsuite/ld-elf/pr22393-1f.d index bc61b63..97be4f6 100644 --- a/ld/testsuite/ld-elf/pr22393-1f.d +++ b/ld/testsuite/ld-elf/pr22393-1f.d @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -z separate-code #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: rx-*-linux* #failif diff --git a/ld/testsuite/ld-elf/pr22393-2a.rd b/ld/testsuite/ld-elf/pr22393-2a.rd index a9c5478..4027ed3 100644 --- a/ld/testsuite/ld-elf/pr22393-2a.rd +++ b/ld/testsuite/ld-elf/pr22393-2a.rd @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -shared -z separate-code --no-rosegment #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* +#target: *-*-linux-gnu *-*-gnu* #failif #... diff --git a/ld/testsuite/ld-elf/pr22393-2b.rd b/ld/testsuite/ld-elf/pr22393-2b.rd index a9c5478..4027ed3 100644 --- a/ld/testsuite/ld-elf/pr22393-2b.rd +++ b/ld/testsuite/ld-elf/pr22393-2b.rd @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -shared -z separate-code --no-rosegment #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* +#target: *-*-linux-gnu *-*-gnu* #failif #... diff --git a/ld/testsuite/ld-elf/pr23161c.rd b/ld/testsuite/ld-elf/pr23161c.rd index be99655..9b19b36 100644 --- a/ld/testsuite/ld-elf/pr23161c.rd +++ b/ld/testsuite/ld-elf/pr23161c.rd @@ -1,6 +1,3 @@ -There are no relocations in this file. - -Symbol table '\.dynsym' contains [0-9]+ entries: - +Num: +Value +Size Type +Bind +Vis +Ndx Name - +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND + - +1: +[a-f0-9]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +foo +#failif +#... +.* _?_(end|edata|_bss_start) diff --git a/ld/testsuite/ld-elf/pr23161d.rd b/ld/testsuite/ld-elf/pr23161d.rd deleted file mode 100644 index e7756b3..0000000 --- a/ld/testsuite/ld-elf/pr23161d.rd +++ /dev/null @@ -1,8 +0,0 @@ -Relocation section '\.rel(a|)\.plt' at offset 0x[0-9a-f]+ contains 1 entry: - +Offset +Info +Type +Sym.* Value +Sym.* Name( \+ Addend|) -[a-f0-9]+ +[0-9a-f]+ +R_.*_JUMP_SLOT +[a-f0-9]+ +foo( \+ [a-f0-9]+|) - -Symbol table '\.dynsym' contains [0-9]+ entries: - +Num: +Value +Size Type +Bind +Vis +Ndx Name - +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND + - +[0-9]+: +[a-f0-9]+ +0 +FUNC +GLOBAL +DEFAULT +UND +foo diff --git a/ld/testsuite/ld-elf/pr23900-1-32.rd b/ld/testsuite/ld-elf/pr23900-1-32.rd index 953095a..810f9a6 100644 --- a/ld/testsuite/ld-elf/pr23900-1-32.rd +++ b/ld/testsuite/ld-elf/pr23900-1-32.rd @@ -1,7 +1,7 @@ #source: pr23900-1.s #ld: #readelf: -l --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* +#target: *-*-linux* *-*-gnu* #... GNU_PROPERTY .* +0x4 diff --git a/ld/testsuite/ld-elf/pr23900-1-64.rd b/ld/testsuite/ld-elf/pr23900-1-64.rd index 62cd63c..7904767 100644 --- a/ld/testsuite/ld-elf/pr23900-1-64.rd +++ b/ld/testsuite/ld-elf/pr23900-1-64.rd @@ -1,7 +1,7 @@ #source: pr23900-1.s #ld: #readelf: -l --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* +#target: *-*-linux* *-*-gnu* #... GNU_PROPERTY .* +0x8 diff --git a/ld/testsuite/ld-elf/pr23900-1.d b/ld/testsuite/ld-elf/pr23900-1.d index da0fcbb..246cfac 100644 --- a/ld/testsuite/ld-elf/pr23900-1.d +++ b/ld/testsuite/ld-elf/pr23900-1.d @@ -1,6 +1,6 @@ #ld: #readelf: --notes --wide -l -#target: *-*-linux* *-*-gnu* *-*-nacl* +#target: *-*-linux* *-*-gnu* #... GNU_PROPERTY .* diff --git a/ld/testsuite/ld-elf/pr23900-2a.d b/ld/testsuite/ld-elf/pr23900-2a.d index 836606d..6806acd 100644 --- a/ld/testsuite/ld-elf/pr23900-2a.d +++ b/ld/testsuite/ld-elf/pr23900-2a.d @@ -1,7 +1,7 @@ #source: pr23900-2.s #ld: #readelf: --notes --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* +#target: *-*-linux* *-*-gnu* #... Displaying notes found in: \.note diff --git a/ld/testsuite/ld-elf/pr23900-2b.d b/ld/testsuite/ld-elf/pr23900-2b.d index 2aa04d7..5b27fe5 100644 --- a/ld/testsuite/ld-elf/pr23900-2b.d +++ b/ld/testsuite/ld-elf/pr23900-2b.d @@ -1,7 +1,7 @@ #source: pr23900-2.s #ld: #readelf: -l --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* +#target: *-*-linux* *-*-gnu* #failif #... diff --git a/ld/testsuite/ld-elf/pr30508.d b/ld/testsuite/ld-elf/pr30508.d index 1692780..d59b9e9 100644 --- a/ld/testsuite/ld-elf/pr30508.d +++ b/ld/testsuite/ld-elf/pr30508.d @@ -1,7 +1,7 @@ #ld: -z separate-code --no-rosegment #objcopy_linked_file: -R .foo #readelf: -lW -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: mips*-*-* rx-*-linux* #... diff --git a/ld/testsuite/ld-elf/pr30907-1.d b/ld/testsuite/ld-elf/pr30907-1.d index ee72bf8..d5d8125 100644 --- a/ld/testsuite/ld-elf/pr30907-1.d +++ b/ld/testsuite/ld-elf/pr30907-1.d @@ -2,7 +2,7 @@ #source: pr22393-1.s #ld: -shared -z separate-code -z relro --rosegment #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #xfail: ![check_relro_support] diff --git a/ld/testsuite/ld-elf/pr30907-2.d b/ld/testsuite/ld-elf/pr30907-2.d index 7312da9..fed957e 100644 --- a/ld/testsuite/ld-elf/pr30907-2.d +++ b/ld/testsuite/ld-elf/pr30907-2.d @@ -2,7 +2,7 @@ #source: pr22393-1.s #ld: -shared -z separate-code -z relro --rosegment #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #xfail: ![check_relro_support] diff --git a/ld/testsuite/ld-elf/pr32341.d b/ld/testsuite/ld-elf/pr32341.d index eb76c3a..45777d4 100644 --- a/ld/testsuite/ld-elf/pr32341.d +++ b/ld/testsuite/ld-elf/pr32341.d @@ -1,6 +1,6 @@ #ld: --build-id -z separate-code -z relro --rosegment #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_relro_support] #failif diff --git a/ld/testsuite/ld-elf/pr33291.d b/ld/testsuite/ld-elf/pr33291.d new file mode 100644 index 0000000..22a8336 --- /dev/null +++ b/ld/testsuite/ld-elf/pr33291.d @@ -0,0 +1,9 @@ +#source: pr33291a.s +#source: pr33291b.s +#ld: -shared +#readelf: -S --wide +#xfail: ![check_shared_lib_support] + +#... + \[[ 0-9]+\] \.rodata[ ]+PROGBITS[ ]+[0-9a-f]+ [0-9a-f]+ 0+9 00 +A +0 +0 +8 +#... diff --git a/ld/testsuite/ld-elf/pr33291a.s b/ld/testsuite/ld-elf/pr33291a.s new file mode 100644 index 0000000..587c0fb --- /dev/null +++ b/ld/testsuite/ld-elf/pr33291a.s @@ -0,0 +1,8 @@ + .globl foo + .section .rodata.cst8,"aM",%progbits,8 + .p2align 3 + .type foo, %object + .size foo, 8 +foo: + .quad 131073 + .section .note.GNU-stack,"",%progbits diff --git a/ld/testsuite/ld-elf/pr33291b.s b/ld/testsuite/ld-elf/pr33291b.s new file mode 100644 index 0000000..69f6b3d --- /dev/null +++ b/ld/testsuite/ld-elf/pr33291b.s @@ -0,0 +1,7 @@ + .globl bar + .section .rodata.cst1,"aM",%progbits,1 + .type bar, %object + .size bar, 1 +bar: + .byte 1 + .section .note.GNU-stack,"",%progbits diff --git a/ld/testsuite/ld-elf/pr33409a.c b/ld/testsuite/ld-elf/pr33409a.c new file mode 100644 index 0000000..c37a5e6 --- /dev/null +++ b/ld/testsuite/ld-elf/pr33409a.c @@ -0,0 +1,20 @@ +#include <stdio.h> + +extern char *array[]; + +char ** +foo (void) +{ + return array; +} + +extern void bar (void); + +int +main() +{ + char **p = foo (); + bar (); + printf ("%s\n", p[0]); + return 0; +} diff --git a/ld/testsuite/ld-elf/pr33409b.c b/ld/testsuite/ld-elf/pr33409b.c new file mode 100644 index 0000000..db64e13 --- /dev/null +++ b/ld/testsuite/ld-elf/pr33409b.c @@ -0,0 +1,9 @@ +#include <stdio.h> + +char *__array [] = +{ + "PASS", + NULL +}; + +extern __typeof (__array) array __attribute__ ((weak, alias ("__array"))); diff --git a/ld/testsuite/ld-elf/pr33409c.c b/ld/testsuite/ld-elf/pr33409c.c new file mode 100644 index 0000000..7de81b3 --- /dev/null +++ b/ld/testsuite/ld-elf/pr33409c.c @@ -0,0 +1,4 @@ +void +bar (void) +{ +} diff --git a/ld/testsuite/ld-elf/rwx-segments-3.err b/ld/testsuite/ld-elf/rwx-segments-3.err new file mode 100644 index 0000000..5a584db --- /dev/null +++ b/ld/testsuite/ld-elf/rwx-segments-3.err @@ -0,0 +1,3 @@ +#... +.* error: .* has a LOAD segment with RWX permissions +#...
\ No newline at end of file diff --git a/ld/testsuite/ld-elf/rwx-segments-4.err b/ld/testsuite/ld-elf/rwx-segments-4.err new file mode 100644 index 0000000..2603f57 --- /dev/null +++ b/ld/testsuite/ld-elf/rwx-segments-4.err @@ -0,0 +1,3 @@ +#... +.*: error: .* has a TLS segment with execute permission +#... diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 09669b5..fad3812 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -516,7 +516,6 @@ run_ld_link_tests { if { [istarget *-*-linux*] || [istarget kvx-*-*] - || [istarget *-*-nacl*] || [istarget *-*-gnu*] } { run_ld_link_tests { {"Weak symbols in dynamic objects 1 (support)" @@ -973,7 +972,13 @@ append build_tests { {pr26580-b.c} {} "libpr26580-2.so"} } +set old_CFLAGS "$CFLAGS_FOR_TARGET_TEST" +set old_CXXFLAGS "$CXXFLAGS_FOR_TARGET_TEST" +append CFLAGS_FOR_TARGET_TEST " $NOSANITIZE_CFLAGS" +append CXXFLAGS_FOR_TARGET_TEST " $NOSANITIZE_CFLAGS" run_cc_link_tests $build_tests +set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" +set CXXFLAGS_FOR_TARGET_TEST "$old_CXXFLAGS" run_cc_link_tests [list \ [list \ @@ -1011,6 +1016,20 @@ run_cc_link_tests [list \ {nm {-u -D --with-symbol-versions} pr26302.nd}} \ "pr26302b.so" \ ] \ + [list \ + "Build pr33409a.o" \ + "" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS" \ + {pr33409a.c} \ + ] \ + [list \ + "Build pr33409.so" \ + "-shared" \ + "-fPIC" \ + {pr33409b.c} \ + {} \ + "pr33409.so" \ + ] \ ] run_ld_link_tests [list \ @@ -1201,6 +1220,17 @@ set run_tests [list \ "tmpdir/pr31482b-no-lto.so tmpdir/pr31482c-no-lto.a \ tmpdir/pr31482d-no-lto.a" \ ] \ + [list "Run pr33409" \ + "-Wl,-z,text" \ + "" \ + {pr33409c.c} \ + "pr33409" \ + "pass.out" \ + "$NO_DIRECT_EXTERN_ACCESS_CFLAGS" \ + "c" \ + "" \ + "tmpdir/pr33409a.o tmpdir/pr33409.so" \ + ] \ ] # NetBSD ELF systems do not currently support the .*_array sections. @@ -1260,10 +1290,10 @@ if [check_libdl_available] { # XFAIL on NetBSD ELF systems as they do not currently support the .*_array # sections. # Disable all sanitizers. - set old_CFLAGS "$CFLAGS_FOR_TARGET" - append CFLAGS_FOR_TARGET " $NOSANITIZE_CFLAGS" + set old_CFLAGS "$CFLAGS_FOR_TARGET_TEST" + append CFLAGS_FOR_TARGET_TEST " $NOSANITIZE_CFLAGS" run_ld_link_exec_tests $dlopen_run_tests "*-*-netbsd*" - set CFLAGS_FOR_TARGET "$old_CFLAGS" + set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" } # Check --no-add-needed and --no-copy-dt-needed-entries @@ -1374,7 +1404,6 @@ run_cc_link_tests $build_cxx_tests run_ld_link_exec_tests $run_cxx_tests if { [istarget *-*-linux*] - || [istarget *-*-nacl*] || [istarget *-*-gnu*] } { run_cc_link_tests [list \ [list \ @@ -1707,7 +1736,6 @@ if [istarget "sparc*-*-*"] { } if { ([istarget "*-*-linux*"] - || [istarget "*-*-nacl*"] || [istarget "*-*-gnu*"]) && ![istarget "mips*-*-*"] } { run_ld_link_tests [list \ @@ -1767,7 +1795,7 @@ if { ([istarget "*-*-linux*"] "" \ $AFLAGS_PIE \ { pr23161b.c } \ - {{readelf {--dyn-syms -rW} pr23161b.rd}} \ + {{readelf {--dyn-syms -W} pr23161b.rd}} \ "pr23161a" \ "-fPIC -O0 $NOSANITIZE_CFLAGS" \ ] \ @@ -1787,23 +1815,17 @@ if { ([istarget "*-*-linux*"] "" \ $AFLAGS_PIE \ { pr23161b.c } \ - {{readelf {--dyn-syms -rW} pr23161b.rd}} \ + {{readelf {--dyn-syms -W} pr23161b.rd}} \ "pr23161b" \ "-fPIC -O0 $NOSANITIZE_CFLAGS" \ ] \ - ] -} - -if { [istarget "i?86-*-*"] - || [istarget "x86_64-*-*"] } { - run_ld_link_tests [list \ [list \ "Build libpr23161c.so" \ "-shared" \ "" \ "$AFLAGS_PIC" \ { pr23161c.c } \ - {{readelf {--dyn-syms -rW} pr23161c.rd}} \ + {{readelf {--dyn-syms -W} pr23161c.rd}} \ "libpr23161c.so" \ "-fPIC -O2 $NOSANITIZE_CFLAGS" \ ] \ @@ -1813,7 +1835,7 @@ if { [istarget "i?86-*-*"] "" \ $AFLAGS_PIE \ { pr23161b.c } \ - {{readelf {--dyn-syms -rW} pr23161d.rd}} \ + {{readelf {--dyn-syms -W} pr23161c.rd}} \ "pr23161c" \ "-fPIC -O0 $NOSANITIZE_CFLAGS" \ ] \ diff --git a/ld/testsuite/ld-elf/tbss4.d b/ld/testsuite/ld-elf/tbss4.d new file mode 100644 index 0000000..336ed8f --- /dev/null +++ b/ld/testsuite/ld-elf/tbss4.d @@ -0,0 +1,13 @@ +#ld: -e _start -Ttext=0x1000 -z max-page-size=0x1000 -z common-page-size=0x1000 -z noseparate-code +#readelf: -lSW +#target: *-linux* *-gnu* +#notarget: hppa64-*-* ia64-*-* + +#... +.* \.tbss +NOBITS +0+1014 +0+1014 +0+4 +0+ +WAT +0 +0 +4 + +#... + +TLS +0x0*1014 +0x0+1014 +0x0+1014 +0x0+ +0x0+4 R +0x4 +#... +.* \.tbss +#pass diff --git a/ld/testsuite/ld-elf/tbss4.s b/ld/testsuite/ld-elf/tbss4.s new file mode 100644 index 0000000..f49491e --- /dev/null +++ b/ld/testsuite/ld-elf/tbss4.s @@ -0,0 +1,25 @@ +# Writeable gcc_except_table is required in order to put this section after +# the DATA_SEGMENT_ALIGN directive in the default linker script (and hence +# in the same PT_LOAD as the PT_TLS segment, and hence so that the +# gcc_except_table can affect the .tbss section location). + .section .gcc_except_table,"aw",%progbits +# Alignment is needed -- otherwise gcc_except_table start position seems to +# be adjusted so that the tbss section is fully aligned. + .balign 4 + .ascii "Odd number of chars" + + .section .tbss,"awT",%nobits + .balign 4 + .type xyz, %object + .size xyz, 4 +xyz: + .zero 4 + + .data +dataval: + .balign 4 + .ascii "x" + + .text + .global _start +_start: diff --git a/ld/testsuite/ld-elf/tls.exp b/ld/testsuite/ld-elf/tls.exp index e53762d..1768399 100644 --- a/ld/testsuite/ld-elf/tls.exp +++ b/ld/testsuite/ld-elf/tls.exp @@ -23,7 +23,6 @@ if { !([istarget *-*-linux*] || [istarget arm*-*-uclinuxfdpiceabi] - || [istarget *-*-nacl*] || [istarget *-*-gnu*]) || [istarget *ecoff] } then { return } diff --git a/ld/testsuite/ld-elf/tls_common.exp b/ld/testsuite/ld-elf/tls_common.exp index 31f36ef..deb22c6 100644 --- a/ld/testsuite/ld-elf/tls_common.exp +++ b/ld/testsuite/ld-elf/tls_common.exp @@ -25,7 +25,6 @@ if { !([istarget *-*-linux*] || [istarget arm*-*-uclinuxfdpiceabi] - || [istarget *-*-nacl*] || [istarget *-*-gnu*]) || [istarget *ecoff] } then { return } diff --git a/ld/testsuite/ld-elf/z_execstack.err b/ld/testsuite/ld-elf/z_execstack.err new file mode 100644 index 0000000..703b42a --- /dev/null +++ b/ld/testsuite/ld-elf/z_execstack.err @@ -0,0 +1,4 @@ +#... +.*: error: creating an executable stack because of -z execstack command line option +#... + |