llvm.org GIT mirror llvm / 35823ce
llvm-readobj: Try the DWARF CFI dumper on all machines. There's no reason to limit the DWARF CFI dumper to EM_386 and EM_X86_64; ELF files could contain DWARF CFI on almost any platform (even 32-bit ARM; NetBSD uses DWARF CFI on that platform). So start using the DWARF CFI dumper unconditionally so that we can dump .eh_frame sections on the remaining ELF platforms as well as in NetBSD binaries. Differential Revision: https://reviews.llvm.org/D58761 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355151 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 8 months ago
4 changed file(s) with 61 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
0 # RUN: llvm-mc -triple arm64-linux -filetype obj -o - %s | llvm-readobj -u | FileCheck %s
1
2 # CHECK: [0x0] CIE length=16
3 # CHECK-NEXT: version: 1
4 # CHECK-NEXT: augmentation: zR
5 # CHECK-NEXT: code_alignment_factor: 1
6 # CHECK-NEXT: data_alignment_factor: -4
7 # CHECK-NEXT: return_address_register: 30
8
9 # CHECK: Program:
10 # CHECK-NEXT: DW_CFA_def_cfa: reg31 +0
11
12 # CHECK: [0x14] FDE length=16 cie=[0x0]
13 # CHECK-NEXT: initial_location: 0x0
14 # CHECK-NEXT: address_range: 0x4 (end : 0x4)
15
16 # CHECK: Program:
17 # CHECK-NEXT: DW_CFA_nop:
18 # CHECK-NEXT: DW_CFA_nop:
19 # CHECK-NEXT: DW_CFA_nop:
20
21 foo:
22 .cfi_startproc
23 ret
24 .cfi_endproc
0 if not 'AArch64' in config.root.targets:
1 config.unsupported = True
2
0 # RUN: llvm-mc -triple arm-linux -filetype obj -o - %s | llvm-readobj -u | FileCheck %s
1
2 # CHECK: [0x0] CIE length=16
3 # CHECK-NEXT: version: 1
4 # CHECK-NEXT: augmentation: zR
5 # CHECK-NEXT: code_alignment_factor: 1
6 # CHECK-NEXT: data_alignment_factor: -4
7 # CHECK-NEXT: return_address_register: 14
8
9 # CHECK: Program:
10 # CHECK-NEXT: DW_CFA_def_cfa: reg13 +0
11
12 # CHECK: [0x14] FDE length=16 cie=[0x0]
13 # CHECK-NEXT: initial_location: 0x0
14 # CHECK-NEXT: address_range: 0x4 (end : 0x4)
15
16 # CHECK: Program:
17 # CHECK-NEXT: DW_CFA_nop:
18 # CHECK-NEXT: DW_CFA_nop:
19 # CHECK-NEXT: DW_CFA_nop:
20
21 .cpu cortex-a8
22
23 foo:
24 .cfi_startproc
25 bx lr
26 .cfi_endproc
18891889
18901890 template
18911891 void ELFDumper::printUnwindInfo() {
1892 const unsigned Machine = ObjF->getELFFile()->getHeader()->e_machine;
1893 if (Machine == EM_386 || Machine == EM_X86_64) {
1894 DwarfCFIEH::PrinterContext Ctx(W, ObjF);
1895 return Ctx.printUnwindInformation();
1896 }
1897 W.startLine() << "UnwindInfo not implemented.\n";
1892 DwarfCFIEH::PrinterContext Ctx(W, ObjF);
1893 Ctx.printUnwindInformation();
18981894 }
18991895
19001896 namespace {
19041900 const unsigned Machine = Obj->getHeader()->e_machine;
19051901 if (Machine == EM_ARM) {
19061902 ARM::EHABI::PrinterContext Ctx(W, Obj, DotSymtabSec);
1907 return Ctx.PrintUnwindInformation();
1908 }
1909 W.startLine() << "UnwindInfo not implemented.\n";
1903 Ctx.PrintUnwindInformation();
1904 }
1905 DwarfCFIEH::PrinterContext Ctx(W, ObjF);
1906 Ctx.printUnwindInformation();
19101907 }
19111908
19121909 } // end anonymous namespace