binutils-gdb/gdb/testsuite/gdb.linespec
Tom de Vries 0f2cd53cf4 [gdb/testsuite] Handle missing .note.GNU-stack
On openSUSE Tumbleweed I run into this for the dwarf assembly test-cases, and
some hardcoded assembly test-cases:
...
 Running gdb.dwarf2/fission-absolute-dwo.exp ...
 gdb compile failed, ld: warning: fission-absolute-dwo.o: \
   missing .note.GNU-stack section implies executable stack
 ld: NOTE: This behaviour is deprecated and will be removed in a future \
   version of the linker

                 === gdb Summary ===

 # of untested testcases         1
...

Fix the dwarf assembly test-cases by adding the missing .note.GNU-stack in
proc Dwarf::assemble.

Fix the hard-coded test-cases using this command:
...
$ for f in $(find gdb/testsuite/gdb.* -name *.S); do
    if ! grep -q note.GNU-stack $f; then
      echo -e "\t.section\t.note.GNU-stack,\"\",@progbits" >> $f;
    fi;
  done
...

Likewise for .s files, and gdb/testsuite/lib/my-syscalls.S.

The idiom for arm seems to be to use %progbits instead, see commit 9a5911c08b
("gdb/testsuite/gdb.dwarf2: Replace @ with % for ARM compatability"), so
hand-edit gdb/testsuite/gdb.arch/arm-disp-step.S to use %progbits instead.

Note that dwarf assembly testcases use %progbits as decided by proc _section.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29674
2022-10-25 14:14:34 +02:00
..
base
3explicit.c
body.h
break-ask.exp
break-asm-file.c
break-asm-file.exp
break-asm-file0.s [gdb/testsuite] Handle missing .note.GNU-stack 2022-10-25 14:14:34 +02:00
break-asm-file1.s [gdb/testsuite] Handle missing .note.GNU-stack 2022-10-25 14:14:34 +02:00
cp-completion-aliases.cc
cp-completion-aliases.exp
cp-replace-typedefs-ns-template.cc
cp-replace-typedefs-ns-template.exp
cpcompletion.exp
cpexplicit.cc
cpexplicit.exp
cpls-abi-tag.cc
cpls-abi-tag.exp
cpls-hyphen.cc
cpls-ops.cc
cpls-ops.exp
cpls.cc
cpls2.cc
errors.exp
explicit.c
explicit.exp
explicit2.c
keywords.c
keywords.exp
linespec.exp
ls-dollar.cc
ls-dollar.exp
ls-errs.c
ls-errs.exp
lspec.cc
lspec.h
macro-relative.c
macro-relative.exp
skip-two.exp
thread.c
thread.exp