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
--- /dev/null
+# RUN: llvm-mc -triple arm64-linux -filetype obj -o - %s | llvm-readobj -u | FileCheck %s
+
+# CHECK: [0x0] CIE length=16
+# CHECK-NEXT: version: 1
+# CHECK-NEXT: augmentation: zR
+# CHECK-NEXT: code_alignment_factor: 1
+# CHECK-NEXT: data_alignment_factor: -4
+# CHECK-NEXT: return_address_register: 30
+
+# CHECK: Program:
+# CHECK-NEXT: DW_CFA_def_cfa: reg31 +0
+
+# CHECK: [0x14] FDE length=16 cie=[0x0]
+# CHECK-NEXT: initial_location: 0x0
+# CHECK-NEXT: address_range: 0x4 (end : 0x4)
+
+# CHECK: Program:
+# CHECK-NEXT: DW_CFA_nop:
+# CHECK-NEXT: DW_CFA_nop:
+# CHECK-NEXT: DW_CFA_nop:
+
+foo:
+.cfi_startproc
+ret
+.cfi_endproc
--- /dev/null
+if not 'AArch64' in config.root.targets:
+ config.unsupported = True
+
--- /dev/null
+# RUN: llvm-mc -triple arm-linux -filetype obj -o - %s | llvm-readobj -u | FileCheck %s
+
+# CHECK: [0x0] CIE length=16
+# CHECK-NEXT: version: 1
+# CHECK-NEXT: augmentation: zR
+# CHECK-NEXT: code_alignment_factor: 1
+# CHECK-NEXT: data_alignment_factor: -4
+# CHECK-NEXT: return_address_register: 14
+
+# CHECK: Program:
+# CHECK-NEXT: DW_CFA_def_cfa: reg13 +0
+
+# CHECK: [0x14] FDE length=16 cie=[0x0]
+# CHECK-NEXT: initial_location: 0x0
+# CHECK-NEXT: address_range: 0x4 (end : 0x4)
+
+# CHECK: Program:
+# CHECK-NEXT: DW_CFA_nop:
+# CHECK-NEXT: DW_CFA_nop:
+# CHECK-NEXT: DW_CFA_nop:
+
+.cpu cortex-a8
+
+foo:
+.cfi_startproc
+bx lr
+.cfi_endproc
template<class ELFT>
void ELFDumper<ELFT>::printUnwindInfo() {
- const unsigned Machine = ObjF->getELFFile()->getHeader()->e_machine;
- if (Machine == EM_386 || Machine == EM_X86_64) {
- DwarfCFIEH::PrinterContext<ELFT> Ctx(W, ObjF);
- return Ctx.printUnwindInformation();
- }
- W.startLine() << "UnwindInfo not implemented.\n";
+ DwarfCFIEH::PrinterContext<ELFT> Ctx(W, ObjF);
+ Ctx.printUnwindInformation();
}
namespace {
const unsigned Machine = Obj->getHeader()->e_machine;
if (Machine == EM_ARM) {
ARM::EHABI::PrinterContext<ELF32LE> Ctx(W, Obj, DotSymtabSec);
- return Ctx.PrintUnwindInformation();
+ Ctx.PrintUnwindInformation();
}
- W.startLine() << "UnwindInfo not implemented.\n";
+ DwarfCFIEH::PrinterContext<ELF32LE> Ctx(W, ObjF);
+ Ctx.printUnwindInformation();
}
} // end anonymous namespace