1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
|
## Tests llvm-dwarfdump handling of AMDGPU relocations. We provide a .debug_info
## section with multiple DW_AT_high_pc entries (that's one of the attributes for
## which relocations are resolved by llvm-dwarfdump) and we add a relocation for
## each of them. The first YAML document represents an amdgcn code object, and
## the second an r600 code object.
# RUN: yaml2obj --docnum=1 -DMACH= %s \
# RUN: | llvm-dwarfdump - 2>&1 | FileCheck --check-prefixes=AMDGCN,UNKNOWN %s
# RUN: yaml2obj --docnum=1 -DMACH=EF_AMDGPU_MACH_AMDGCN_GFX803 %s \
# RUN: | llvm-dwarfdump - 2>&1 | FileCheck --check-prefixes=AMDGCN,KNOWN %s
# RUN: yaml2obj --docnum=2 -DMACH= %s \
# RUN: | llvm-dwarfdump - 2>&1 | FileCheck --check-prefixes=R600,UNKNOWN %s
# RUN: yaml2obj --docnum=2 -DMACH=EF_AMDGPU_MACH_R600_R600 %s \
# RUN: | llvm-dwarfdump - 2>&1 | FileCheck --check-prefixes=R600,KNOWN %s
# UNKNOWN: -: Error in creating MCRegInfo
# KNOWN-NOT: -: Error in creating MCRegInfo
# AMDGCN: -: file format elf64-amdgpu
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
OSABI: ELFOSABI_AMDGPU_HSA
ABIVersion: 0x02
Type: ET_REL
Machine: EM_AMDGPU
Flags: [[[MACH]]]
DWARF:
debug_abbrev:
- Table:
- Code: 1
Tag: DW_TAG_compile_unit
Children: DW_CHILDREN_no
Attributes:
- Attribute: DW_AT_high_pc
Form: DW_FORM_addr
- Attribute: DW_AT_high_pc
Form: DW_FORM_addr
- Attribute: DW_AT_high_pc
Form: DW_FORM_addr
- Attribute: DW_AT_high_pc
Form: DW_FORM_addr
- Attribute: DW_AT_high_pc
Form: DW_FORM_addr
- Attribute: DW_AT_high_pc
Form: DW_FORM_addr
- Attribute: DW_AT_high_pc
Form: DW_FORM_addr
- Attribute: DW_AT_high_pc
Form: DW_FORM_addr
debug_info:
- Version: 4
AddrSize: 8
Entries:
- AbbrCode: 1
Values:
- Value: 0x4242424242424242
- Value: 0x4242424242424242
- Value: 0x4242424242424242
- Value: 0x4242424242424242
- Value: 0x4242424242424242
- Value: 0x4242424242424242
- Value: 0x4242424242424242
- Value: 0x4242424242424242
Sections:
- Name: .rela.debug_info
Type: SHT_RELA
Flags: [ SHF_INFO_LINK ]
AddressAlign: 0x0000000000000008
Info: .debug_info
Relocations:
# AMDGCN: DW_AT_high_pc (0x0000000000000001)
- Offset: 0x000000000000000C # 0xC + 8*0
Type: R_AMDGPU_ABS64
Symbol: v1
Addend: 0x0
# AMDGCN-NEXT: DW_AT_high_pc (0x0000000000000043)
- Offset: 0x0000000000000014 # 0xC + 8*1
Type: R_AMDGPU_ABS64
Symbol: v1
Addend: 0x42
# AMDGCN-NEXT: DW_AT_high_pc (0xffffffffffffffff)
- Offset: 0x000000000000001C # 0xC + 8*2
Type: R_AMDGPU_ABS64
Symbol: v0
Addend: 0xffffffffffffffff
# AMDGCN-NEXT: DW_AT_high_pc (0xffffffffffffffff)
- Offset: 0x0000000000000024 # 0xC + 8*3
Type: R_AMDGPU_ABS64
Symbol: vffffffffffffffff
Addend: 0x0
# AMDGCN: DW_AT_high_pc (0x0000000000000001)
- Offset: 0x000000000000002C # 0xC + 8*4
Type: R_AMDGPU_ABS32
Symbol: v1
Addend: 0x0
# AMDGCN-NEXT: DW_AT_high_pc (0x0000000000000043)
- Offset: 0x0000000000000034 # 0xC + 8*5
Type: R_AMDGPU_ABS32
Symbol: v1
Addend: 0x42
# AMDGCN-NEXT: DW_AT_high_pc (0xffffffffffffffff)
- Offset: 0x000000000000003C # 0xC + 8*6
Type: R_AMDGPU_ABS32
Symbol: v0
Addend: 0xffffffffffffffff
# AMDGCN-NEXT: DW_AT_high_pc (0xffffffffffffffff)
- Offset: 0x0000000000000044 # 0xC + 8*7
Type: R_AMDGPU_ABS32
Symbol: vffffffffffffffff
Addend: 0x0
Symbols:
- Name: v0
Type: STT_SECTION
Section: .debug_info
Value: 0x0
- Name: v1
Type: STT_SECTION
Section: .debug_info
Value: 0x1
- Name: vffffffffffffffff
Type: STT_SECTION
Section: .debug_info
Value: 0xffffffffffffffff
...
# R600: -: file format elf32-amdgpu
--- !ELF
FileHeader:
Class: ELFCLASS32
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_AMDGPU
Flags: [[[MACH]]]
DWARF:
debug_abbrev:
- Table:
- Code: 0x00000001
Tag: DW_TAG_compile_unit
Children: DW_CHILDREN_no
Attributes:
- Attribute: DW_AT_high_pc
Form: DW_FORM_addr
- Attribute: DW_AT_high_pc
Form: DW_FORM_addr
- Attribute: DW_AT_high_pc
Form: DW_FORM_addr
- Attribute: DW_AT_high_pc
Form: DW_FORM_addr
debug_info:
- Version: 4
AddrSize: 4
Entries:
- AbbrCode: 1
Values:
- Value: 0x42424242
- Value: 0x42424242
- Value: 0x42424242
- Value: 0x42424242
Sections:
- Name: .rela.debug_info
Type: SHT_RELA
Flags: [ SHF_INFO_LINK ]
AddressAlign: 0x0000000000000001
Info: .debug_info
Relocations:
## FIXME: Is R_AMDGPU_ABS64 meaningful here?
# R600: DW_AT_high_pc (0x00000001)
- Offset: 0x0000000C # 0xC + 4*0
Type: R_AMDGPU_ABS32
Symbol: v1
Addend: 0x0
# R600-NEXT: DW_AT_high_pc (0x00000043)
- Offset: 0x00000010 # 0xC + 4*1
Type: R_AMDGPU_ABS32
Symbol: v1
Addend: 0x42
## FIXME: Why is this field printed as sign-extended 64-bit in a 32-bit executable?
# R600-NEXT: DW_AT_high_pc (0xffffffffffffffff)
- Offset: 0x00000014 # 0xC + 4*2
Type: R_AMDGPU_ABS32
Symbol: v0
Addend: 0xffffffff
# R600-NEXT: DW_AT_high_pc (0xffffffff)
- Offset: 0x00000018 # 0xC + 4*3
Type: R_AMDGPU_ABS32
Symbol: vffffffff
Addend: 0x0
Symbols:
- Name: v0
Type: STT_SECTION
Section: .debug_info
Value: 0x0
- Name: v1
Type: STT_SECTION
Section: .debug_info
Value: 0x1
- Name: vffffffff
Type: STT_SECTION
Section: .debug_info
Value: 0xffffffff
...
|