xref: /llvm-project/llvm/test/DebugInfo/debug-frame-cie-pointer-reloc.test (revision be66cf221bbe6bb119d478e69fd2ca21872e2ad3)
1*be66cf22SIgor Kudrin# RUN: yaml2obj %s -o - | \
2*be66cf22SIgor Kudrin# RUN:   llvm-dwarfdump -debug-frame - | \
3*be66cf22SIgor Kudrin# RUN:   FileCheck %s
4*be66cf22SIgor Kudrin
5*be66cf22SIgor Kudrin## This checks that we resolve relocations when reading CIE pointers.
6*be66cf22SIgor Kudrin## The second FDE references the second CIE. The value for the CIE pointer
7*be66cf22SIgor Kudrin## field in the raw section data is 0, thus, to recover the real reference,
8*be66cf22SIgor Kudrin## it is required to read the addend from the corresponding RELA relocation.
9*be66cf22SIgor Kudrin
10*be66cf22SIgor Kudrin# CHECK: .debug_frame contents:
11*be66cf22SIgor Kudrin# CHECK: 00000000 0000000c ffffffff CIE
12*be66cf22SIgor Kudrin# CHECK: 00000010 00000014 00000000 FDE cie=00000000 pc=00000000...00000001
13*be66cf22SIgor Kudrin# CHECK: 00000028 0000000c ffffffff CIE
14*be66cf22SIgor Kudrin# CHECK: 00000038 00000014 00000028 FDE cie=00000028 pc=00000010...00000011
15*be66cf22SIgor Kudrin
16*be66cf22SIgor Kudrin--- !ELF
17*be66cf22SIgor KudrinFileHeader:
18*be66cf22SIgor Kudrin  Class:   ELFCLASS64
19*be66cf22SIgor Kudrin  Data:    ELFDATA2LSB
20*be66cf22SIgor Kudrin  Type:    ET_REL
21*be66cf22SIgor Kudrin  Machine: EM_X86_64
22*be66cf22SIgor KudrinSections:
23*be66cf22SIgor Kudrin  - Name:    .debug_frame
24*be66cf22SIgor Kudrin    Type:    SHT_PROGBITS
25*be66cf22SIgor Kudrin    Content: 0C000000FFFFFFFF02000178100000001400000000000000000000000000000001000000000000000C000000FFFFFFFF0200017810000000140000000000000010000000000000000100000000000000
26*be66cf22SIgor Kudrin  - Name:    .rela.debug_frame
27*be66cf22SIgor Kudrin    Type:    SHT_RELA
28*be66cf22SIgor Kudrin    Info:    .debug_frame
29*be66cf22SIgor Kudrin    Relocations:
30*be66cf22SIgor Kudrin      - Offset: 0x0000000000000014
31*be66cf22SIgor Kudrin        Symbol: .debug_frame
32*be66cf22SIgor Kudrin        Type:   R_X86_64_32
33*be66cf22SIgor Kudrin      - Offset: 0x000000000000003C
34*be66cf22SIgor Kudrin        Symbol: .debug_frame
35*be66cf22SIgor Kudrin        Type:   R_X86_64_32
36*be66cf22SIgor Kudrin        Addend: 0x28
37*be66cf22SIgor KudrinSymbols:
38*be66cf22SIgor Kudrin  - Name:    .debug_frame
39*be66cf22SIgor Kudrin    Type:    STT_SECTION
40*be66cf22SIgor Kudrin    Section: .debug_frame
41*be66cf22SIgor Kudrin...
42