[Frontend] Remove unused includes (NFC) (#116927)
[llvm-project.git] / llvm / test / DebugInfo / ARM / dwarfdump-rela.yaml
blobf65e56a196bdecbcae03651e1e9bda6c78c57a20
1 # Test if we are handling RELA relocations for ARM correctly using llvm-dwarfdump.
3 # RUN: yaml2obj %s -o %t
4 # RUN: llvm-dwarfdump -i %t | FileCheck %s
6 # CHECK:      DW_TAG_compile_unit
7 # CHECK-NEXT: DW_AT_name {{.*}}("correct")
8 # CHECK-NEXT: DW_AT_type ([[TYPEDIE:0x[0-9A-Fa-f]+]] "correct")
9 # CHECK:      [[TYPEDIE]]: DW_TAG_base_type
10 # CHECK-NEXT: DW_AT_name {{.*}}("correct")
12 --- !ELF
13 FileHeader:
14   Class:           ELFCLASS32
15   Data:            ELFDATA2LSB
16   Type:            ET_REL
17   Machine:         EM_ARM
18   Flags:           [ EF_ARM_EABI_VER5 ]
19 Sections:
20   # A rudimentary v5 compile unit with an AT_name and an AT_type referencing
21   # a rudimentary DW_TAG_base_type DIE with an AT_name attribute.
22   - Name:            .debug_info
23     Type:            SHT_PROGBITS
24     Content:         17000000050001040000000001A000000000000000020000000000
25   - Name:            .debug_abbrev
26     Type:            SHT_PROGBITS
27     Content:         011101030E49130000022400030E000000
28   - Name:            .debug_str
29     Type:            SHT_PROGBITS
30   - Name:            .rela.debug_info
31     Type:            SHT_RELA
32     Link:            .symtab
33     AddressAlign:    0x4
34     Offset:          0x929
35     Info:            .debug_info
36     Relocations:
37       - Offset:          0x8
38         Symbol:          .debug_abbrev
39         Type:            R_ARM_ABS32
40       # The compile unit name is found via a R_ARM_ABS32 relocation.
41       - Offset:          0xD
42         Symbol:          .debug_str
43         Type:            R_ARM_ABS32
44         Addend:          6
45       # The DW_TAG_base_type is found via a R_ARM_REL32 relocation.
46       # This is completely artificial and unlikely to be ever generated
47       # by a compiler or other tool. We make sure that the relocation is
48       # resolved by (Symbol - Offset + Addend).
49       - Offset:          0x11
50         Symbol:          .debug_info
51         Type:            R_ARM_REL32
52         Addend:          0x26
53       - Offset:          0x16
54         Symbol:          .debug_str
55         Type:            R_ARM_ABS32
56         Addend:          6
57   - Type:            SectionHeaderTable
58     Sections:
59       - Name:            .symtab
60       - Name:            .strtab
61       - Name:            .shstrtab
62       - Name:            .debug_info
63       - Name:            .debug_abbrev
64       - Name:            .debug_str
65       - Name:            .rela.debug_info
66 Symbols:
67   - Name:            test.cpp
68     Type:            STT_FILE
69     Index:           SHN_ABS
70   - Name:            .debug_info
71     Type:            STT_SECTION
72     Section:         .debug_info
73   - Name:            .debug_abbrev
74     Type:            STT_SECTION
75     Section:         .debug_abbrev
76   - Name:            .debug_str
77     Type:            STT_SECTION
78     Section:         .debug_str
79   - Name:            .debug_info_cudie
80     Type:            STT_OBJECT
81     Section:         .debug_info
82     Value:           0xC
83 DWARF:
84   debug_str:
85     - 'wrong'
86     - 'correct'
87 ...