brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.3 KiB · 669a402 Raw
222 lines · yaml
1## Tests llvm-dwarfdump handling of AMDGPU relocations. We provide a .debug_info2## section with multiple DW_AT_high_pc entries (that's one of the attributes for3## which relocations are resolved by llvm-dwarfdump) and we add a relocation for4## each of them. The first YAML document represents an amdgcn code object, and5## the second an r600 code object.6 7# RUN: yaml2obj --docnum=1 -DMACH= %s \8# RUN:   | llvm-dwarfdump - 2>&1 | FileCheck --check-prefixes=AMDGCN,UNKNOWN %s9# RUN: yaml2obj --docnum=1 -DMACH=EF_AMDGPU_MACH_AMDGCN_GFX803 %s \10# RUN:   | llvm-dwarfdump - 2>&1 | FileCheck --check-prefixes=AMDGCN,KNOWN %s11 12# RUN: yaml2obj --docnum=2 -DMACH= %s \13# RUN:   | llvm-dwarfdump - 2>&1 | FileCheck --check-prefixes=R600,UNKNOWN %s14# RUN: yaml2obj --docnum=2 -DMACH=EF_AMDGPU_MACH_R600_R600 %s \15# RUN:   | llvm-dwarfdump - 2>&1 | FileCheck --check-prefixes=R600,KNOWN %s16 17# UNKNOWN:   -: Error in creating MCRegInfo18# KNOWN-NOT: -: Error in creating MCRegInfo19 20# AMDGCN: -:      file format elf64-amdgpu21 22--- !ELF23FileHeader:24  Class:      ELFCLASS6425  Data:       ELFDATA2LSB26  OSABI:      ELFOSABI_AMDGPU_HSA27  ABIVersion: 0x0228  Type:       ET_REL29  Machine:    EM_AMDGPU30  Flags:      [[[MACH]]]31DWARF:32  debug_abbrev:33    - Table:34        - Code:     135          Tag:      DW_TAG_compile_unit36          Children: DW_CHILDREN_no37          Attributes:38            - Attribute: DW_AT_high_pc39              Form:      DW_FORM_addr40            - Attribute: DW_AT_high_pc41              Form:      DW_FORM_addr42            - Attribute: DW_AT_high_pc43              Form:      DW_FORM_addr44            - Attribute: DW_AT_high_pc45              Form:      DW_FORM_addr46            - Attribute: DW_AT_high_pc47              Form:      DW_FORM_addr48            - Attribute: DW_AT_high_pc49              Form:      DW_FORM_addr50            - Attribute: DW_AT_high_pc51              Form:      DW_FORM_addr52            - Attribute: DW_AT_high_pc53              Form:      DW_FORM_addr54  debug_info:55    - Version:  456      AddrSize: 857      Entries:58        - AbbrCode: 159          Values:60            - Value: 0x424242424242424261            - Value: 0x424242424242424262            - Value: 0x424242424242424263            - Value: 0x424242424242424264            - Value: 0x424242424242424265            - Value: 0x424242424242424266            - Value: 0x424242424242424267            - Value: 0x424242424242424268Sections:69  - Name:         .rela.debug_info70    Type:         SHT_RELA71    Flags:        [ SHF_INFO_LINK ]72    AddressAlign: 0x000000000000000873    Info:         .debug_info74    Relocations:75 76      # AMDGCN: DW_AT_high_pc (0x0000000000000001)77      - Offset: 0x000000000000000C # 0xC + 8*078        Type:   R_AMDGPU_ABS6479        Symbol: v180        Addend: 0x081 82      # AMDGCN-NEXT: DW_AT_high_pc (0x0000000000000043)83      - Offset: 0x0000000000000014 # 0xC + 8*184        Type:   R_AMDGPU_ABS6485        Symbol: v186        Addend: 0x4287 88      # AMDGCN-NEXT: DW_AT_high_pc (0xffffffffffffffff)89      - Offset: 0x000000000000001C # 0xC + 8*290        Type:   R_AMDGPU_ABS6491        Symbol: v092        Addend: 0xffffffffffffffff93 94      # AMDGCN-NEXT: DW_AT_high_pc (0xffffffffffffffff)95      - Offset: 0x0000000000000024 # 0xC + 8*396        Type:   R_AMDGPU_ABS6497        Symbol: vffffffffffffffff98        Addend: 0x099 100      # AMDGCN: DW_AT_high_pc (0x0000000000000001)101      - Offset: 0x000000000000002C # 0xC + 8*4102        Type:   R_AMDGPU_ABS32103        Symbol: v1104        Addend: 0x0105 106      # AMDGCN-NEXT: DW_AT_high_pc (0x0000000000000043)107      - Offset: 0x0000000000000034 # 0xC + 8*5108        Type:   R_AMDGPU_ABS32109        Symbol: v1110        Addend: 0x42111 112      # AMDGCN-NEXT: DW_AT_high_pc (0xffffffffffffffff)113      - Offset: 0x000000000000003C # 0xC + 8*6114        Type:   R_AMDGPU_ABS32115        Symbol: v0116        Addend: 0xffffffffffffffff117 118      # AMDGCN-NEXT: DW_AT_high_pc (0xffffffffffffffff)119      - Offset: 0x0000000000000044 # 0xC + 8*7120        Type:   R_AMDGPU_ABS32121        Symbol: vffffffffffffffff122        Addend: 0x0123 124Symbols:125  - Name:    v0126    Type:    STT_SECTION127    Section: .debug_info128    Value:   0x0129  - Name:    v1130    Type:    STT_SECTION131    Section: .debug_info132    Value:   0x1133  - Name:    vffffffffffffffff134    Type:    STT_SECTION135    Section: .debug_info136    Value:   0xffffffffffffffff137...138 139# R600: -:      file format elf32-amdgpu140 141--- !ELF142FileHeader:143  Class:   ELFCLASS32144  Data:    ELFDATA2LSB145  Type:    ET_REL146  Machine: EM_AMDGPU147  Flags:   [[[MACH]]]148DWARF:149  debug_abbrev:150    - Table:151        - Code:     0x00000001152          Tag:      DW_TAG_compile_unit153          Children: DW_CHILDREN_no154          Attributes:155            - Attribute: DW_AT_high_pc156              Form:      DW_FORM_addr157            - Attribute: DW_AT_high_pc158              Form:      DW_FORM_addr159            - Attribute: DW_AT_high_pc160              Form:      DW_FORM_addr161            - Attribute: DW_AT_high_pc162              Form:      DW_FORM_addr163  debug_info:164    - Version: 4165      AddrSize: 4166      Entries:167        - AbbrCode: 1168          Values:169            - Value: 0x42424242170            - Value: 0x42424242171            - Value: 0x42424242172            - Value: 0x42424242173Sections:174  - Name:         .rela.debug_info175    Type:         SHT_RELA176    Flags:        [ SHF_INFO_LINK ]177    AddressAlign: 0x0000000000000001178    Info:         .debug_info179    Relocations:180 181      ## FIXME: Is R_AMDGPU_ABS64 meaningful here?182 183      # R600: DW_AT_high_pc (0x00000001)184      - Offset: 0x0000000C # 0xC + 4*0185        Type:   R_AMDGPU_ABS32186        Symbol: v1187        Addend: 0x0188 189      # R600-NEXT: DW_AT_high_pc (0x00000043)190      - Offset: 0x00000010 # 0xC + 4*1191        Type:   R_AMDGPU_ABS32192        Symbol: v1193        Addend: 0x42194 195      ## FIXME: Why is this field printed as sign-extended 64-bit in a 32-bit executable?196      # R600-NEXT: DW_AT_high_pc (0xffffffffffffffff)197      - Offset: 0x00000014 # 0xC + 4*2198        Type:   R_AMDGPU_ABS32199        Symbol: v0200        Addend: 0xffffffff201 202      # R600-NEXT: DW_AT_high_pc (0xffffffff)203      - Offset: 0x00000018 # 0xC + 4*3204        Type:   R_AMDGPU_ABS32205        Symbol: vffffffff206        Addend: 0x0207 208Symbols:209  - Name:    v0210    Type:    STT_SECTION211    Section: .debug_info212    Value:   0x0213  - Name:    v1214    Type:    STT_SECTION215    Section: .debug_info216    Value:   0x1217  - Name:    vffffffff218    Type:    STT_SECTION219    Section: .debug_info220    Value:   0xffffffff221...222