brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · 706d386 Raw
119 lines · yaml
1## Test that in the presence of SHT_LLVM_BB_ADDR_MAP sections,2## --symbolize-operands can display <BB*> labels properly in a relocatable3## object file.4 5## Relocatable Object file.6# RUN: yaml2obj %s -o %t17# RUN: llvm-objdump %t1 -d --symbolize-operands -M att --no-show-raw-insn --no-leading-addr | \8# RUN:   FileCheck %s -DSYM=symbol --match-full-lines9 10--- !ELF11FileHeader:12  Class:           ELFCLASS6413  Data:            ELFDATA2LSB14  Type:            ET_REL15  Machine:         EM_X86_6416  SectionHeaderStringTable: .strtab17Sections:18  - Name:    .text19    Type:    SHT_PROGBITS20    Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]21    Content: FFFF22  - Name:    .llvm_bb_addr_map23    Type:    SHT_LLVM_BB_ADDR_MAP24    Link:    .text25    Entries:26      - Version: 227        BBRanges:28          - BBEntries:29             - ID:              030               AddressOffset:   0x031               Size:            0x132               Metadata:        0xa33      - Version: 234        BBRanges:35          - BBEntries:36            - ID:              037              AddressOffset:   0x038              Size:            0x139              Metadata:        0xb40      - Version: 241        Feature: 0x842        BBRanges:43          - BBEntries:44            - ID:              045              AddressOffset:   0x046              Size:            0x147              Metadata:        0xc48          - BBEntries:49            - ID:              150              AddressOffset:   0x051              Size:            0x152              Metadata:        0xd53  - Name:  .rela.llvm_bb_addr_map54    Type:  SHT_RELA55    Flags: [ SHF_INFO_LINK ]56    Link:  .symtab57    Info:  .llvm_bb_addr_map58    Relocations:59      - Offset: 0x260        Symbol: .text61        Type:   R_X86_64_6462      - Offset: 0x1163        Symbol: .text64        Type:   R_X86_64_6465        Addend: 166      - Offset: 0x2167        Symbol: .text68        Type:   R_X86_64_6469        Addend: 0x270      - Offset: 0x2e71        Symbol: .text72        Type:   R_X86_64_6473        Addend: 0x374 75Symbols:76  - Name:    a77    Section: .text78    Value:   0x079  - Name:    c80    Section: .text81    Value:   0x182  - Name:    h83    Section: .text84    Value:   0x285  - Name:    h186    Section: .text87    Value:   0x388  - Name:    .text89    Type:    STT_SECTION90    Section: .text91 92# CHECK:      <a>:93# CHECK-NEXT: <BB0>:94# CHECK:      <c>:95# CHECK-NEXT: <BB0>:96 97## Check that if we're missing a relocation section we get the appropriate98## warning.99 100# RUN: yaml2obj %s --docnum=2 -o %t2101# RUN: llvm-readobj %t2 --bb-addr-map 2>&1 | FileCheck %s --check-prefix=NO-RELA-SECTION -DFILE=%t2102 103--- !ELF104FileHeader:105  Class:           ELFCLASS64106  Data:            ELFDATA2LSB107  Type:            ET_REL108  Machine:         EM_X86_64109Sections:110  - Name:    .text111    Type:    SHT_PROGBITS112    Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]113    Content: FF114  - Name:    .llvm_bb_addr_map115    Type:    SHT_LLVM_BB_ADDR_MAP116    Link:    .text117 118# NO-RELA-SECTION: warning: '[[FILE]]': unable to get relocation section for SHT_LLVM_BB_ADDR_MAP section with index 2119