brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 87dad02 Raw
122 lines · plain
1## Under some circumstances, GNU tools strip/objcopy change REL to RELA. https://sourceware.org/bugzilla/show_bug.cgi?id=280352## Test that LLD can handle call graph profile data relocated with RELA relocations.3# REQUIRES: x864 5# RUN: yaml2obj %s -o %t.o6# RUN: ld.lld --call-graph-profile-sort=hfsort %t.o -o %t7# RUN: llvm-nm --no-sort %t | FileCheck %s8# RUN: ld.lld --no-call-graph-profile-sort %t.o -o %t9# RUN: llvm-nm --no-sort %t | FileCheck %s --check-prefix=NO-CG10 11# RUN: yaml2obj -DTYPE=SHT_CREL %s -o %tcrel.o12# RUN: ld.lld --call-graph-profile-sort=hfsort %tcrel.o -o %t13# RUN: llvm-nm --no-sort %t | FileCheck %s14 15# CHECK: 0000000000201124 t D16# CHECK: 0000000000201122 t C17# CHECK: 0000000000201128 t B18# CHECK: 0000000000201120 t A19# CHECK: 0000000000201126 T _start20 21# NO-CG: 0000000000201120 t D22# NO-CG: 0000000000201122 t C23# NO-CG: 0000000000201124 t B24# NO-CG: 0000000000201126 t A25# NO-CG: 0000000000201128 T _start26 27--- !ELF28FileHeader:29  Class: ELFCLASS6430  Data:  ELFDATA2LSB31  Type:  ET_REL32  Machine: EM_X86_6433Sections:34  - Name: .text.D35    Type: SHT_PROGBITS36    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]37    Size: 238  - Name: .text.C39    Type: SHT_PROGBITS40    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]41    Size: 242  - Name: .text.B43    Type: SHT_PROGBITS44    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]45    Size: 246  - Name: .text.A47    Type: SHT_PROGBITS48    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]49    Size: 250  - Name: .text._start51    Type: SHT_PROGBITS52    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]53    Size: 254  - Name: .llvm.call-graph-profile55    Type: SHT_LLVM_CALL_GRAPH_PROFILE56    Flags: [ SHF_EXCLUDE ]57    Link: .symtab58    AddressAlign: 0x159    Entries:60      - Weight: 1061      - Weight: 1062      - Weight: 8063      - Weight: 4064      - Weight: 3065      - Weight: 9066  - Name: .rela.llvm.call-graph-profile67    Type: [[TYPE=SHT_RELA]]68    Info: .llvm.call-graph-profile69    Relocations:70      - Offset: 0x071        Symbol: A72        Type:   R_X86_64_NONE73      - Offset: 0x074        Symbol: B75        Type:   R_X86_64_NONE76      - Offset: 0x877        Symbol: A78        Type:   R_X86_64_NONE79      - Offset: 0x880        Symbol: B81        Type:   R_X86_64_NONE82      - Offset: 0x1083        Symbol: _start84        Type:   R_X86_64_NONE85      - Offset: 0x1086        Symbol: B87        Type:   R_X86_64_NONE88      - Offset: 0x1889        Symbol: A90        Type:   R_X86_64_NONE91      - Offset: 0x1892        Symbol: C93        Type:   R_X86_64_NONE94      - Offset: 0x2095        Symbol: B96        Type:   R_X86_64_NONE97      - Offset: 0x2098        Symbol: C99        Type:   R_X86_64_NONE100      - Offset: 0x28101        Symbol: C102        Type:   R_X86_64_NONE103      - Offset: 0x28104        Symbol: D105        Type:   R_X86_64_NONE106Symbols:107  - Name: D108    Type: STT_FUNC109    Section: .text.D110  - Name: C111    Type: STT_FUNC112    Section: .text.C113  - Name: B114    Type: STT_FUNC115    Section: .text.B116  - Name: A117    Type: STT_FUNC118    Section: .text.A119  - Name: _start120    Binding: STB_GLOBAL121    Section: .text._start122