Browse Source
Add a flag to control the version of CIE that is generated. By default gas produces CIE version 1, and this continues to be the default after this patch. However, a user can now provide --gdwarf-cie-version=NUMBER to switch to either version 3 or version 4 of CIE, version 2 was never released, and so causes an error as does any number less than 1 or greater than 4. Producing version 4 CIE requires two new fields to be added to the CIE, an address size field, and an segment selector field. For a flat address space the DWARF specification indicates that the segment selector should be 0, and the address size fields just contains the address size in bytes. For now we support 4 or 8 byte addresses, and the segment selector is always produced as 0. At some future time we might need to allow targets to override this. gas/ChangeLog: * as.c (parse_args): Parse --gdwarf-cie-version option. (flag_dwarf_cie_version): New variable. * as.h (flag_dwarf_cie_version): Declare. * dw2gencfi.c (output_cie): Switch from DW_CIE_VERSION to flag_dwarf_cie_version. * doc/as.texi (Overview): Document --gdwarf-cie-version. * NEWS: Likewise. * testsuite/gas/cfi/cfi.exp: Add new tests. * testsuite/gas/cfi/cie-version-0.d: New file. * testsuite/gas/cfi/cie-version-1.d: New file. * testsuite/gas/cfi/cie-version-2.d: New file. * testsuite/gas/cfi/cie-version-3.d: New file. * testsuite/gas/cfi/cie-version-4.d: New file. * testsuite/gas/cfi/cie-version.s: New file. include/ChangeLog: * dwarf2.h (DW_CIE_VERSION): Delete. Change-Id: I9de19461aeb8332b5a57bbfe802953d0725a7ae8gdb-9-branch
15 changed files with 129 additions and 3 deletions
@ -0,0 +1,5 @@ |
|||
#objdump: --dwarf=frames |
|||
#name: CIE Version 0 |
|||
#as: --gdwarf-cie-version=0 |
|||
#source: cie-version.s |
|||
#error: Invalid --gdwarf-cie-version `0' |
|||
@ -0,0 +1,17 @@ |
|||
#objdump: --dwarf=frames |
|||
#name: CIE Version 1 |
|||
#as: --gdwarf-cie-version=1 |
|||
#source: cie-version.s |
|||
#... |
|||
.*: file format .* |
|||
|
|||
Contents of the .eh_frame section: |
|||
|
|||
00000000 0+[0-9a-f]+ 0+000 CIE |
|||
Version: 1 |
|||
Augmentation: "zR" |
|||
Code alignment factor: .* |
|||
Data alignment factor: .* |
|||
Return address column: .* |
|||
Augmentation data: [01][abc] |
|||
#... |
|||
@ -0,0 +1,5 @@ |
|||
#objdump: --dwarf=frames |
|||
#name: CIE Version 2 |
|||
#as: --gdwarf-cie-version=2 |
|||
#source: cie-version.s |
|||
#error: Invalid --gdwarf-cie-version `2' |
|||
@ -0,0 +1,17 @@ |
|||
#objdump: --dwarf=frames |
|||
#name: CIE Version 3 |
|||
#as: --gdwarf-cie-version=3 |
|||
#source: cie-version.s |
|||
#... |
|||
.*: file format .* |
|||
|
|||
Contents of the .eh_frame section: |
|||
|
|||
00000000 0+[0-9a-f]+ 0+000 CIE |
|||
Version: 3 |
|||
Augmentation: "zR" |
|||
Code alignment factor: .* |
|||
Data alignment factor: .* |
|||
Return address column: .* |
|||
Augmentation data: [01][abc] |
|||
#... |
|||
@ -0,0 +1,19 @@ |
|||
#objdump: --dwarf=frames |
|||
#name: CIE Version 4 |
|||
#as: --gdwarf-cie-version=4 |
|||
#source: cie-version.s |
|||
#... |
|||
.*: file format .* |
|||
|
|||
Contents of the .eh_frame section: |
|||
|
|||
00000000 0+[0-9a-f]+ 0+000 CIE |
|||
Version: 4 |
|||
Augmentation: "zR" |
|||
Pointer Size: .* |
|||
Segment Size: .* |
|||
Code alignment factor: .* |
|||
Data alignment factor: .* |
|||
Return address column: .* |
|||
Augmentation data: [01][abc] |
|||
#... |
|||
@ -0,0 +1,2 @@ |
|||
.cfi_startproc |
|||
.cfi_endproc |
|||
Loading…
Reference in new issue