[PATCH] D82852: [ELF][test] Add some additional .eh_frame/.eh_frame_hdr testing
James Henderson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 2 08:06:26 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5012ddd5aff2: [ELF][test] Add some additional .eh_frame/.eh_frame_hdr testing (authored by jhenderson).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82852/new/
https://reviews.llvm.org/D82852
Files:
lld/test/ELF/eh-frame-hdr-comdat.s
lld/test/ELF/eh-frame-merge.s
lld/test/ELF/eh-frame-type.test
Index: lld/test/ELF/eh-frame-type.test
===================================================================
--- lld/test/ELF/eh-frame-type.test
+++ lld/test/ELF/eh-frame-type.test
@@ -1,17 +1,26 @@
-# RUN: yaml2obj %s -o %t.o
-# RUN: ld.lld %t.o -o %t -shared
-# RUN: llvm-readobj -S %t | FileCheck %s
+## Show that LLD can handle .eh_frame sections of different types.
+
+# RUN: yaml2obj %s -o %t1.o -D TYPE=SHT_PROGBITS
+# RUN: ld.lld %t1.o -o %t1
+# RUN: llvm-readobj -S %t1 | FileCheck %s
+
+# RUN: yaml2obj %s -o %t2.o -D TYPE=SHT_X86_64_UNWIND
+# RUN: ld.lld %t2.o -o %t2
+# RUN: llvm-readobj -S %t2 | FileCheck %s
+
+# RUN: ld.lld %t1.o %t2.o -o %tboth
+# RUN: llvm-readobj -S %tboth | FileCheck %s
# CHECK: Name: .eh_frame
# CHECK-NEXT: Type: SHT_PROGBITS
-!ELF
+--- !ELF
FileHeader:
- Class: ELFCLASS64
- Data: ELFDATA2LSB
- Type: ET_REL
- Machine: EM_X86_64
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
Sections:
- - Name: .eh_frame
- Type: SHT_PROGBITS
- Flags: [ SHF_ALLOC ]
+ - Name: .eh_frame
+ Type: [[TYPE]]
+ Flags: [ SHF_ALLOC ]
Index: lld/test/ELF/eh-frame-merge.s
===================================================================
--- lld/test/ELF/eh-frame-merge.s
+++ lld/test/ELF/eh-frame-merge.s
@@ -3,6 +3,11 @@
// RUN: ld.lld --hash-style=sysv %t.o %t.o -o %t -shared
// RUN: llvm-readobj -S --section-data %t | FileCheck %s
+/// Also show that the merging happens when going via a -r link.
+// RUN: ld.lld -r %t.o %t.o -o %t.r.o
+// RUN: ld.lld --hash-style=sysv %t.r.o -o %t2 -shared
+// RUN: llvm-readobj -S --section-data %t2 | FileCheck %s
+
.section foo,"ax", at progbits
.cfi_startproc
nop
Index: lld/test/ELF/eh-frame-hdr-comdat.s
===================================================================
--- /dev/null
+++ lld/test/ELF/eh-frame-hdr-comdat.s
@@ -0,0 +1,37 @@
+# REQUIRES: x86
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t
+# RUN: ld.lld %t %t -o %t2 --eh-frame-hdr
+# RUN: llvm-readelf -u --symbols %t2 | FileCheck %s
+
+# CHECK: EHFrameHeader {
+# CHECK-NEXT: Address:
+# CHECK-NEXT: Offset:
+# CHECK-NEXT: Size: 0x14
+# CHECK-NEXT: Corresponding Section: .eh_frame_hdr
+# CHECK-NEXT: Header {
+# CHECK-NEXT: version: 1
+# CHECK-NEXT: eh_frame_ptr_enc:
+# CHECK-NEXT: fde_count_enc:
+# CHECK-NEXT: table_enc:
+# CHECK-NEXT: eh_frame_ptr:
+# CHECK-NEXT: fde_count: 1
+# CHECK-NEXT: entry 0 {
+# CHECK-NEXT: initial_location: 0x[[# %x, SYM:]]
+# CHECK-NEXT: address: 0x[[# %x, FDE:]]
+# CHECK-NEXT: }
+# CHECK-NEXT: }
+# CHECK-NEXT: }
+
+# CHECK: [0x[[# FDE]]] FDE
+
+# CHECK: Symbol table
+# CHECK-NEXT: Num: Value {{.*}} Name
+# CHECK: {{0+}}[[# SYM]] {{.*}} bar
+
+.section .text.bar,"axG", at progbits,bar,comdat
+.global bar
+bar:
+.cfi_startproc
+ ret
+.cfi_endproc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82852.275127.patch
Type: text/x-patch
Size: 2990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200702/803ee265/attachment.bin>
More information about the llvm-commits
mailing list