diff options
author | Alan Modra <amodra@gmail.com> | 2022-06-15 22:30:51 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-06-16 09:54:55 +0930 |
commit | 45bf072b34068b5a98947862b2aa183ab646e7ea (patch) | |
tree | 39c30c9557e46988678a0f92698b9c4ad556e728 /gas | |
parent | 0fbc4f6aeb3f66f86d93ab45d508e351b1c5c9f5 (diff) | |
download | gdb-45bf072b34068b5a98947862b2aa183ab646e7ea.zip gdb-45bf072b34068b5a98947862b2aa183ab646e7ea.tar.gz gdb-45bf072b34068b5a98947862b2aa183ab646e7ea.tar.bz2 |
PR29250, readelf erases CIE initial register state
PR 29250
binutils/
* dwarf.c (display_debug_frames): Set col_type[reg] on sizing
pass over FDE to cie->col_type[reg] if CIE specifies reg.
Handle DW_CFA_restore and DW_CFA_restore_extended on second
pass using the same logic. Remove unnecessary casts. Don't
call frame_need_space on second pass over FDE.
gas/
* testsuite/gas/i386/ehinterp.d,
* testsuite/gas/i386/ehinterp.s: New test.
* testsuite/gas/i386/i386.exp: Run it.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/testsuite/gas/i386/ehinterp.d | 20 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/ehinterp.s | 35 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/i386.exp | 2 |
3 files changed, 56 insertions, 1 deletions
diff --git a/gas/testsuite/gas/i386/ehinterp.d b/gas/testsuite/gas/i386/ehinterp.d new file mode 100644 index 0000000..5b6ac858 --- /dev/null +++ b/gas/testsuite/gas/i386/ehinterp.d @@ -0,0 +1,20 @@ +#readelf: --debug-dump=frames-interp + +Contents of the \.eh_frame section: + +0+ 0+14 0+ CIE "zR" cf=1 df=-8 ra=16 + +LOC +CFA +ra * +0+ rsp\+8 +c-8 * + +0+18 0+10 0+1c FDE cie=0+ pc=0+..0+6 + +LOC +CFA +ra * +0+ rsp\+8 +c-8 * +0+4 rsp\+8 +u * + +0+2c 0+20 0+30 FDE cie=0+ pc=0+6..0+24 + +LOC +CFA +rbp +ra * +0+6 rsp\+8 +u +c-8 * +0+b rsp\+16 +c-16 +c-8 * +0+e rbp\+16 +c-16 +c-8 * +0+23 rsp\+8 +c-16 +c-8 * + diff --git a/gas/testsuite/gas/i386/ehinterp.s b/gas/testsuite/gas/i386/ehinterp.s new file mode 100644 index 0000000..634cef1 --- /dev/null +++ b/gas/testsuite/gas/i386/ehinterp.s @@ -0,0 +1,35 @@ + .file "hello.c" + .text + .section .rodata +.LC0: + .string "Hello" + .text + .globl dummy + .type dummy, @function +dummy: + .cfi_startproc + endbr64 + .cfi_undefined rip + jmp . + .cfi_endproc + .size dummy, .-dummy + + .globl main + .type main, @function +main: + .cfi_startproc + endbr64 + pushq %rbp + .cfi_def_cfa_offset 16 + .cfi_offset 6, -16 + movq %rsp, %rbp + .cfi_def_cfa_register 6 + leaq .LC0(%rip), %rax + movq %rax, %rdi + call puts@PLT + movl $0, %eax + popq %rbp + .cfi_def_cfa 7, 8 + ret + .cfi_endproc + .size main, .-main diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index 99a11eb..a4fc5b4 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -1339,7 +1339,7 @@ if [gas_64_check] then { if {[istarget "*-*-linux*"]} then { run_dump_test "x86-64-align-branch-3" } - + run_dump_test ehinterp } run_dump_test pr27198 |