3 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
4 # RUN: ld.lld --eh-frame-hdr --section-start .text=0x1000 %t.o -o %t
5 # RUN: llvm-readobj -S --section-data %t | FileCheck %s
7 ## Check we are able to handle DW_EH_PE_udata2 encoding.
11 # CHECK: Name: .eh_frame_hdr
12 # CHECK-NEXT: Type: SHT_PROGBITS
14 # CHECK-NEXT: SHF_ALLOC
16 # CHECK-NEXT: Address: 0x2004
17 # CHECK-NEXT: Offset: 0x1004
18 # CHECK-NEXT: Size: 20
21 # CHECK-NEXT: AddressAlignment: 4
22 # CHECK-NEXT: EntrySize: 0
23 # CHECK-NEXT: SectionData (
24 # CHECK-NEXT: 0000: 011B033B 10000000 01000000 30F2FFFF
25 # CHECK-NEXT: 0010: 26000000
26 # Header (always 4 bytes): 011B033B
27 # 10000000 = .eh_frame(0x2018) - .eh_frame_hdr(0x2004) - 4
28 # 01000000 = 1 = the number of FDE pointers in the table.
29 # 30F2FFFF = foo(0x1000) - 0x234(addend) - .eh_frame_hdr(0x2004)
33 # CHECK: Name: .eh_frame
34 # CHECK-NEXT: Type: SHT_PROGBITS
36 # CHECK-NEXT: SHF_ALLOC
38 # CHECK-NEXT: Address: 0x2018
39 # CHECK-NEXT: Offset: 0x1018
43 # CHECK-NEXT: AddressAlignment:
44 # CHECK-NEXT: EntrySize:
45 # CHECK-NEXT: SectionData (
46 # CHECK-NEXT: 0000: 0E000000 00000000 01525300 01010102
47 # CHECK-NEXT: 0010: FF000600 00001600 00003412 00000000
49 # ---> ADDR(foo) + 0x234 = 0x1234
56 .section .eh_frame,"a",@unwind
61 .byte 0x52 # Augmentation string: 'R','S','\0'
70 .byte 0x02 # DW_EH_PE_udata2