Files
binutils-gdb/gdb/testsuite/gdb.arch/pa64-nullify.s
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

72 lines
1.1 KiB
ArmAsm

.LEVEL 2.0w
.text
.align 8
.globl foo
.type foo, @function
foo:
.PROC
.CALLINFO FRAME=64,NO_CALLS,SAVE_SP,ENTRY_GR=3
.ENTRY
copy %r3,%r1
copy %r30,%r3
std,ma %r1,64(%r30)
std %r3,-8(%r30)
ldo -64(%r29),%r28
stw %r26,0(%r28)
ldw 0(%r28),%r28
extrd,s %r28,63,32,%r28
ldo 64(%r3),%r30
ldd,mb -64(%r30),%r3
nop
bve,n (%r2)
.EXIT
.PROCEND
.align 8
.globl bar
.type bar, @function
bar:
.PROC
.CALLINFO FRAME=64,NO_CALLS,SAVE_SP,ENTRY_GR=3
.ENTRY
copy %r3,%r1
copy %r30,%r3
std,ma %r1,64(%r30)
std %r3,-8(%r30)
ldo 64(%r3),%r30
ldd,mb -64(%r30),%r3
bve,n (%r2)
.EXIT
.PROCEND
.align 8
.globl main
.type main, @function
main:
.PROC
.CALLINFO FRAME=128,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4
.ENTRY
std %r2,-16(%r30)
copy %r3,%r1
copy %r30,%r3
std,ma %r1,128(%r30)
std %r3,-8(%r30)
std %r4,8(%r3)
ldo -64(%r29),%r28
stw %r26,0(%r28)
std %r25,8(%r28)
ldw 0(%r28),%r26
ldo -48(%r30),%r29
copy %r27,%r4
b,l foo,%r2
nop
copy %r4,%r27
ldd -16(%r3),%r2
ldd 8(%r3),%r4
ldo 64(%r3),%r30
ldd,mb -64(%r30),%r3
bve,n (%r2)
.EXIT
.PROCEND
.section .note.GNU-stack,"",@progbits