binutils-gdb/gdb/testsuite/gdb.disasm
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
..
am33.exp
am33.s
disassembler-options.exp
h8300s.exp
h8300s.s
hppa.exp
hppa.s
mn10200.s
mn10300.exp
mn10300.s
sh3.exp
sh3.s
t01_mov.exp
t01_mov.s
t02_mova.exp
t02_mova.s
t03_add.exp
t03_add.s
t04_sub.exp
t04_sub.s
t05_cmp.exp
t05_cmp.s
t06_ari2.exp
t06_ari2.s
t07_ari3.exp
t07_ari3.s
t08_or.exp
t08_or.s
t09_xor.exp
t09_xor.s
t10_and.exp
t10_and.s
t11_logs.exp
t11_logs.s
t12_bit.exp
t12_bit.s
t13_otr.exp
t13_otr.s