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
9a5911c08be
("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
mov x30, 0x1234
ret x0
.cfi_endproc
+ .section .note.GNU-stack,"",@progbits
nop /* Incorrect. */
nop
nop
+ .section .note.GNU-stack,"",@progbits
var128:
.8byte 0xaa55aa55aa55aa55
.8byte 0x55aa55aa55aa55aa
+ .section .note.GNU-stack,"",@progbits
test_rep_ret:
repz
ret
+ .section .note.GNU-stack,"",@progbits
int3
nop
nop
+ .section .note.GNU-stack,"",@progbits
nop
fld1
nop
+ .section .note.GNU-stack,"",@progbits
#define MINSYM nop; .globl minsym; minsym: nop
/*8*/ MINSYM
/*a*/ hlt
+ .section .note.GNU-stack,"",@progbits
xor %rax,%rax
ret
+ .section .note.GNU-stack,"",@progbits
STAP_PROBE1(probe, fail2_probe, 23-@$16)
xor %rax,%rax
ret
+ .section .note.GNU-stack,"",@progbits
STAP_PROBE2(probe, bar, -4@-($4), -4@$-3+($22/$2)-$16)
xor %rax,%rax
ret
+ .section .note.GNU-stack,"",@progbits
.LASF2:
.string "argv"
.ident "GCC: (GNU) 4.9.2 20150212 (Red Hat 4.9.2-6)"
+ .section .note.GNU-stack,"",@progbits
j_s [blink]
.align 4
+ .section .note.GNU-stack,"",@progbits
.Lend:
+ .section .note.GNU-stack,"",@progbits
foo:
lr r0, [tlbpd0]
.end foo
+ .section .note.GNU-stack,"",@progbits
bx lr
.size test_add_rn_pc, .-test_add_rn_pc
#endif
+ .section .note.GNU-stack,"",%progbits
.short 260
.size _sub2, .-_sub2
.ident "GCC: (GNU) 3.5.0 20040204 (experimental)"
+ .section .note.GNU-stack,"",@progbits
.short 260
.size _sub2, .-_sub2
.ident "GCC: (GNU) 3.5.0 20040204 (experimental)"
+ .section .note.GNU-stack,"",@progbits
.cfi_endproc
.LFE2:
.size main, .-main
+ .section .note.GNU-stack,"",@progbits
.global test_ret
test_ret:
ret
+ .section .note.GNU-stack,"",@progbits
val: .byte 0x00,0x00,0x45,0x07,0x11,0x19,0x22,0xe9,0xfe,0xbf
smallval: .byte 0xe9,0xd0,0xd7,0x65,0x81,0xb7,0x43,0xc6,0x5c,0x6a
bigval: .byte 0x6a,0x45,0x90,0xdc,0x03,0xc1,0xf8,0xc6,0xe5,0x03
+ .section .note.GNU-stack,"",@progbits
SYMBOL(main):
int3
ret
+ .section .note.GNU-stack,"",@progbits
bar:
move $2, $8
.end bar
+ .section .note.GNU-stack,"",@progbits
bv,n %r0(%r2)
.EXIT
.PROCEND
+ .section .note.GNU-stack,"",@progbits
bve,n (%r2)
.EXIT
.PROCEND
+ .section .note.GNU-stack,"",@progbits
blr
+ .section .note.GNU-stack,"",@progbits
.long 0x11e0e28e /* vupklsb v15,v28 */
.long 0x110042ce /* vupklsh v8,v8 */
.long 0x13201cc4 /* vxor v25,v0,v3 */
+ .section .note.GNU-stack,"",@progbits
.long 0x11e0f7c3 /* vpopcntd v15,v30 */
.long 0x105f36c7 /* vcmpgtud. v2,v31,v6 */
.long 0x128f17c7 /* vcmpgtsd. v20,v15,v2 */
+ .section .note.GNU-stack,"",@progbits
.long 0x11e90f4d /* vextuhrx r15,r9,v1 */
.long 0x12b1878d /* vextuwrx r21,r17,v16 */
.long 0x1295b5e3 /* vmsumudm v20,v21,v22,v23 */
+ .section .note.GNU-stack,"",@progbits
lnia 9 # /* set r9 */
blr
+ .section .note.GNU-stack,"",@progbits
.long 0xabbbcbdb # <<- loaded into vs7
.long 0xacbcccdc # <<-
+ .section .note.GNU-stack,"",@progbits
.long 0x80060003
.long 0x05000000 /* xxspltiw vs0,8 */
.long 0x80060008
+ .section .note.GNU-stack,"",@progbits
.long 0x7d80e3a6 /* mtppr r12 */
.long 0x7da2e3a6 /* mtppr32 r13 */
.long 0x7d605264 /* tlbie r10,r11 */
+ .section .note.GNU-stack,"",@progbits
.long 0x7d81492d /* stwcx. r12,r1,r9 */
.long 0x7da051ad /* stdcx. r13,0,r10 */
.long 0x7da151ad /* stdcx. r13,r1,r10 */
+ .section .note.GNU-stack,"",@progbits
.long 0xffd7048e /* mffscrni f30,0 */
.long 0xffd71c8e /* mffscrni f30,3 */
.long 0xfff8048e /* mffsl f31 */
+ .section .note.GNU-stack,"",@progbits
mr 1,11
blr
FUNC_END(foo)
+ .section .note.GNU-stack,"",@progbits
mtlr sp
blr
FUNC_END(main)
+ .section .note.GNU-stack,"",@progbits
li 3, 0
blr
+ .section .note.GNU-stack,"",@progbits
.long 0xf102e293 /* xxspltw vs40,vs60,2 */
.long 0x7d00a699 /* lxvd2x vs40,0,r20 */
.long 0x7d00a799 /* stxvd2x vs40,0,r20 */
+ .section .note.GNU-stack,"",@progbits
.long 0xf360d52d /* xscvspdpn vs59,vs26 */
.long 0xff0e168c /* fmrgow f24,f14,f2 */
.long 0xfec72f8c /* fmrgew f22,f7,f5 */
+ .section .note.GNU-stack,"",@progbits
.long 0xfe766688 /* xscvdpqp v19,v12 */
.long 0xfdb92688 /* xscvqpsdz v13,v4 */
.long 0xfcf83ec8 /* xsiexpqp v7,v24,v7 */
+ .section .note.GNU-stack,"",@progbits
li 3, 0
blr
+ .section .note.GNU-stack,"",@progbits
#else
.size .main,.-.main
#endif
+ .section .note.GNU-stack,"",@progbits
#else
.size .test_atomic_sequences,.-.test_atomic_sequences
#endif
+ .section .note.GNU-stack,"",@progbits
mov r0, #0
bx lr
.size main, .-main
+ .section .note.GNU-stack,"",@progbits
addi sp,sp,16
jr ra
.size func, .-func
+ .section .note.GNU-stack,"",@progbits
addi sp,sp,32
jr ra
.size foo, .-foo
+ .section .note.GNU-stack,"",@progbits
addi sp,sp,32
jr ra
.size foo, .-foo
+ .section .note.GNU-stack,"",@progbits
.byte 0,1
1: st %r15,0(%r15)
br %r14
+ .section .note.GNU-stack,"",@progbits
.align 8
flags: .xword 0x0000000000000000
.size flags, .-flags
+ .section .note.GNU-stack,"",@progbits
mov r0, #0
bx lr
.size main, .-main
+ .section .note.GNU-stack,"",@progbits
pop {r3, pc}
.size main, .-main
+ .section .note.GNU-stack,"",@progbits
bx lr
#endif /* __thumb2__ */
+ .section .note.GNU-stack,"",@progbits
gdbasm_datavar staticvar 5
.include "note.inc"
+ .section .note.GNU-stack,"",@progbits
comment "mark: foo2 leave"
gdbasm_leave
gdbasm_end foo2
+ .section .note.GNU-stack,"",@progbits
.section sect2, "a"
var2: .byte 2
+ .section .note.GNU-stack,"",@progbits
jmp .L1
.L2:
ret /* bp.2 */
+ .section .note.GNU-stack,"",@progbits
.Lhandler:
mov $1, %eax
ret
+ .section .note.GNU-stack,"",@progbits
.LASF0:
.string "GNU C 4.8.2 20131212 (Red Hat 4.8.2-7) -mtune=generic -march=x86-64 -g"
.ident "GCC: (GNU) 4.8.2 20131212 (Red Hat 4.8.2-7)"
+ .section .note.GNU-stack,"",@progbits
mov_leq (r1+,4),r2
mov_lne (r1+,4),r2
mov_lra (r1+,4),r2
+ .section .note.GNU-stack,"",@progbits
block_data_transfer_tests:
eepmov.b
eepmov.w
+ .section .note.GNU-stack,"",@progbits
bv,n 0(%r2)
.EXIT
.PROCEND
+ .section .note.GNU-stack,"",@progbits
sub 32767,a2
sub 131071,a2
subc d1,d2
+ .section .note.GNU-stack,"",@progbits
sub 131071,a1
subc d1,d2
+ .section .note.GNU-stack,"",@progbits
sts fpscr,r3
sts.l fpscr,@-r3
+ .section .note.GNU-stack,"",@progbits
.end
+ .section .note.GNU-stack,"",@progbits
mova/l.l @(0x12345678:32,@0x9ABCDEF0:32.w),er1 ;015F48D99ABCDEF012345678
.end
+ .section .note.GNU-stack,"",@progbits
add.l @0x12345678:32,@0x9abcdef0:32 ;01046b2c1234567848109abcdef0
.end
+ .section .note.GNU-stack,"",@progbits
sub.l @0x12345678:32,@0x9abcdef0:32 ;01046b2c1234567848309abcdef0
.end
+ .section .note.GNU-stack,"",@progbits
cmp.l @0x12345678:32,@0x9abcdef0:32 ;01046b2c1234567848209abcdef0
.end
+ .section .note.GNU-stack,"",@progbits
divs.l er3,er1 ;01d25331
.end
+ .section .note.GNU-stack,"",@progbits
exts.l #2,@0x12345678:32 ;01046b281234567817e0
.end
+ .section .note.GNU-stack,"",@progbits
or.l @0x12345678:32,@0x9abcdef0:32 ;01046b2c1234567848409abcdef0
.end
+ .section .note.GNU-stack,"",@progbits
xor.l @0x12345678:32,@0x9abcdef0:32 ;01046b2c1234567848509abcdef0
.end
+ .section .note.GNU-stack,"",@progbits
and.l @0x12345678:32,@0x9abcdef0:32 ;01046b2c1234567848609abcdef0
.end
+ .section .note.GNU-stack,"",@progbits
rotr.l #2,@0x12345678:32 ;01046b281234567813f0
.end
+ .section .note.GNU-stack,"",@progbits
bfst r3h,#0x34:8,@0x12345678:32 ;6a3812345678f334
.end
+ .section .note.GNU-stack,"",@progbits
nop ;0000
.end
+ .section .note.GNU-stack,"",@progbits
.byte 1
.Lline1_end:
+ .section .note.GNU-stack,"",@progbits
.uleb128 0x1
.byte 0x1
LELT:
+ .section .note.GNU-stack,"",@progbits
.uleb128 0x1
.byte 0x1
LELT:
+ .section .note.GNU-stack,"",@progbits
.byte 0x0
.byte 0x0
.byte 0x0
+ .section .note.GNU-stack,"",@progbits
.section .debug_line
.Ldebug_line0:
+ .section .note.GNU-stack,"",@progbits
.byte 1
.Lline1_end:
+ .section .note.GNU-stack,"",@progbits
.size some_func,.-some_func
some_func_end:
nop
+ .section .note.GNU-stack,"",@progbits
.byte 0x0
.byte 0x0
.byte 0x0
+ .section .note.GNU-stack,"",@progbits
.byte 1
.Lline1_end:
+ .section .note.GNU-stack,"",@progbits
.byte 0x0
.byte 0x0
.byte 0x0
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.uleb128 1
.byte 1
.Lgcc43_end:
+ .section .note.GNU-stack,"",@progbits
.byte 0x9c
.byte 0x00
.byte 0x92
+ .section .note.GNU-stack,"",@progbits
.byte 1
.Lline1_end:
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator .debug_abbrev
section. */
+ .section .note.GNU-stack,"",@progbits
.byte 0x0
.byte 0x0
+ .section .note.GNU-stack,"",@progbits
.byte 0x0
.byte 0x0
+ .section .note.GNU-stack,"",@progbits
.section .debug_abbrev
.Ldebug_abbrev0:
.byte 0x0
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.byte 0x0
.byte 0x0
+ .section .note.GNU-stack,"",@progbits
.byte 0x0
.byte 0x0
.byte 0x0
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.byte 0x08 /* DW_FORM_string. */
.2byte 0x0000 /* End abbrev. */
.byte 0x00 /* End abbrev table. */
+ .section .note.GNU-stack,"",@progbits
.Lline1_begin:
.byte 0
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.byte 1
.Lline1_end:
+ .section .note.GNU-stack,"",@progbits
.byte 1
.Lline1_end:
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.string "GNU Modula-2 0.78 (20100402) grafted onto GCC 4.1.2"
.LASF2:
.string ""
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.byte 1
.Lline1_end:
+ .section .note.GNU-stack,"",@progbits
.byte 1
.Lline1_end:
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.byte 0x0
.byte 0x0
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.byte 0x0
.byte 0x0
.byte 0x0
+ .section .note.GNU-stack,"",@progbits
.byte 1
.Lline1_end:
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
jmp 1b
.cfi_endproc
.endfunc
+ .section .note.GNU-stack,"",@progbits
.string "sizetype"
.LASF1:
.string "char"
+ .section .note.GNU-stack,"",@progbits
.byte 1
.Lline1_end:
+ .section .note.GNU-stack,"",@progbits
.byte 0x0
.byte 0x0
.byte 0x0
+ .section .note.GNU-stack,"",@progbits
.string "hello world!\n"
.Lemptyname:
.string ""
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.byte 0x0
.byte 0x0
.byte 0x0
+ .section .note.GNU-stack,"",@progbits
.Ldebug_addr0:
.4byte .LFB0 /* DW_AT_low_pc */
.4byte SYMBOL(baz) /* DW_AT_location */
+ .section .note.GNU-stack,"",@progbits
.global __cu_high_pc
__cu_high_pc:
+ .section .note.GNU-stack,"",@progbits
.uleb128 0x0 /* Included from line number 0 */
.uleb128 0x0 /* Filename we just started (bug: number too small) */
.byte 0x0 /* end of CU's macro information */
+ .section .note.GNU-stack,"",@progbits
.LASF4:
.string "GNU C++ 4.4.2"
.ident "GCC: (GNU) 4.4.2"
+ .section .note.GNU-stack,"",@progbits
.LASF3:
.string "main"
+ .section .note.GNU-stack,"",@progbits
.byte 1
.Lline1_end:
+ .section .note.GNU-stack,"",@progbits
.byte 1
.Lline1_end:
+ .section .note.GNU-stack,"",@progbits
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .section .note.GNU-stack,"",@progbits
.rept 5
nop
.endr
+ .section .note.GNU-stack,"",@progbits
_write_deferred_output
+ _section .note.GNU-stack "" progbits
+
if { $file_id == "" } {
catch {close $_output_file}
}
#else
# error "Unsupported architecture"
#endif
+
+ .section .note.GNU-stack,"",@progbits