[COFF] Map truncated .eh_frame section name
PE/COFF sections can have section names truncated to 8 chars, in order to
have the name available at runtime. (The string table, where long untruncated
names are stored, isn't loaded at runtime.)
This allows various llvm tools to dump the .eh_frame section from such
executables.
Patch by Peiyuan Song!
Differential Revision: https://reviews.llvm.org/D55407
llvm-svn: 348708
diff --git a/llvm/test/tools/llvm-objdump/eh_frame-coff.test b/llvm/test/tools/llvm-objdump/eh_frame-coff.test
new file mode 100644
index 0000000..74eceee
--- /dev/null
+++ b/llvm/test/tools/llvm-objdump/eh_frame-coff.test
@@ -0,0 +1,28 @@
+# RUN: yaml2obj %p/Inputs/eh_frame-coff.yaml | llvm-objdump -dwarf=frames - 2>/dev/null | FileCheck %s
+
+# CHECK: .eh_frame contents:
+
+# CHECK: 00000000 0000001c ffffffff CIE
+# CHECK: Version: 1
+# CHECK: Augmentation: "zPLR"
+# CHECK: Code alignment factor: 1
+# CHECK: Data alignment factor: -4
+# CHECK: Return address column: 8
+# CHECK: Personality Address: 004025d7
+# CHECK: Augmentation data: 00 D7 25 40 00 00 00
+
+# CHECK: DW_CFA_def_cfa: reg4 +4
+# CHECK: DW_CFA_offset: reg8 -4
+# CHECK: DW_CFA_nop:
+# CHECK: DW_CFA_nop:
+
+# CHECK: 00000020 0000001c 00000024 FDE cie=00000024 pc=00401410...00401488
+# CHECK: LSDA Address: 00406000
+# CHECK: DW_CFA_advance_loc: 1
+# CHECK: DW_CFA_def_cfa_offset: +8
+# CHECK: DW_CFA_offset: reg5 -8
+# CHECK: DW_CFA_advance_loc: 2
+# CHECK: DW_CFA_def_cfa_register: reg5
+# CHECK: DW_CFA_nop:
+# CHECK: DW_CFA_nop:
+# CHECK: DW_CFA_nop: