Browse Source
(dot_cfi, output_cfi_insn): Handle DW_CFA_GNU_window_save. (output_cie): Don't use DW_EH_PE_pcrel if neither DIFF_EXPR_OK nor tc_cfi_emit_pcrel_expr are defined. (output_fde): Use tc_cfi_emit_pcrel_expr if available and DIFF_EXPR_OK is not defined. * config/tc-sparc.h (TARGET_USE_CFIPOP): Define. (tc_cfi_frame_initial_instructions, tc_regname_to_dw2regnum, tc_cfi_emit_pcrel_expr): Define. (sparc_cfi_frame_initial_instructions, sparc_regname_to_dw2regnum, sparc_cfi_emit_pcrel_expr): New prototypes. (sparc_cie_data_alignment): New decl. (DWARF2_DEFAULT_RETURN_COLUMN, DWARF2_CIE_DATA_ALIGNMENT): Define. * config/tc-sparc.c: Include dw2gencfi.h. (sparc_cie_data_alignment): New variable. (md_begin): Initialize it. (sparc_cfi_frame_initial_instructions): New function. (sparc_regname_to_dw2regnum): Likewise. (sparc_cfi_emit_pcrel_expr): Likewise. * doc/as.texinfo: Document .cfi_gnu_window_save. * config/tc-sparc.c (s_common): Cast last argument to long and change format string to shut up warning. testsuite/ * gas/cfi/cfi-sparc-1.s: New test. * gas/cfi/cfi-sparc-1.d: New test. * gas/cfi/cfi-sparc64-1.s: New test. * gas/cfi/cfi-sparc64-1.d: New test. * gas/cfi/cfi.exp: Run them.ezannoni_pie-20030916-branch
11 changed files with 251 additions and 4 deletions
@ -0,0 +1,22 @@ |
|||
#readelf: -wf |
|||
#name: CFI on SPARC 32-bit |
|||
#as: -32 |
|||
|
|||
The section .eh_frame contains: |
|||
|
|||
00000000 00000010 00000000 CIE |
|||
Version: 1 |
|||
Augmentation: "zR" |
|||
Code alignment factor: 4 |
|||
Data alignment factor: -4 |
|||
Return address column: 15 |
|||
Augmentation data: 1b |
|||
|
|||
DW_CFA_def_cfa: r14 ofs 0 |
|||
|
|||
00000014 00000014 00000018 FDE cie=00000000 pc=0000001c..00000040 |
|||
DW_CFA_advance_loc: 4 to 00000020 |
|||
DW_CFA_def_cfa_reg: r30 |
|||
DW_CFA_GNU_window_save |
|||
DW_CFA_register: r15 in r31 |
|||
|
|||
@ -0,0 +1,23 @@ |
|||
#; $ as -o test.o -32 gas-cfi-test.s && gcc -m32 -nostdlib -o test test.o |
|||
|
|||
.file "a.c" |
|||
.text |
|||
.align 4 |
|||
.globl foo |
|||
.type foo, @function |
|||
foo: |
|||
.cfi_startproc |
|||
save %sp, -104, %sp |
|||
.cfi_def_cfa_register %fp |
|||
.cfi_gnu_window_save |
|||
.cfi_register %o7, %i7 |
|||
add %i0, 1, %o0 |
|||
call bar, 0 |
|||
add %i0, 2, %i0 |
|||
call bar, 0 |
|||
mov %i0, %o0 |
|||
add %o0, 3, %o0 |
|||
ret |
|||
restore %g0, %o0, %o0 |
|||
.cfi_endproc |
|||
.size foo, .-foo |
|||
@ -0,0 +1,25 @@ |
|||
#readelf: -wf |
|||
#name: CFI on SPARC 64-bit |
|||
#as: -64 |
|||
|
|||
The section .eh_frame contains: |
|||
|
|||
00000000 00000011 00000000 CIE |
|||
Version: 1 |
|||
Augmentation: "zR" |
|||
Code alignment factor: 4 |
|||
Data alignment factor: -8 |
|||
Return address column: 15 |
|||
Augmentation data: 1b |
|||
|
|||
DW_CFA_def_cfa: r14 ofs 2047 |
|||
|
|||
00000015 00000017 00000019 FDE cie=00000000 pc=0000001d..0000004d |
|||
DW_CFA_advance_loc: 4 to 00000021 |
|||
DW_CFA_def_cfa_reg: r30 |
|||
DW_CFA_GNU_window_save |
|||
DW_CFA_register: r15 in r31 |
|||
DW_CFA_nop |
|||
DW_CFA_nop |
|||
DW_CFA_nop |
|||
|
|||
@ -0,0 +1,26 @@ |
|||
#; $ as -o test.o -64 gas-cfi-test.s && gcc -m64 -nostdlib -o test test.o |
|||
|
|||
.file "a.c" |
|||
.text |
|||
.align 4 |
|||
.globl foo |
|||
.type foo, @function |
|||
foo: |
|||
.cfi_startproc |
|||
save %sp, -192, %sp |
|||
.cfi_def_cfa_register %fp |
|||
.cfi_gnu_window_save |
|||
.cfi_register %o7, %i7 |
|||
add %i0, 1, %o0 |
|||
add %i0, 2, %i0 |
|||
call bar, 0 |
|||
sra %o0, 0, %o0 |
|||
sra %i0, 0, %i0 |
|||
call bar, 0 |
|||
mov %i0, %o0 |
|||
add %o0, 3, %o0 |
|||
sra %o0, 0, %o0 |
|||
ret |
|||
restore %g0, %o0, %o0 |
|||
.cfi_endproc |
|||
.size foo, .-foo |
|||
Loading…
Reference in new issue