1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s -sr -t | FileCheck %s
3 // When doing a rename, all the checks for where the relocation should go
4 // should be performed with the original symbol. Only if we decide to relocate
5 // with the symbol we should then use the renamed one.
7 // This is a regression test for a bug where we used bar5@@@zed when deciding
8 // if we should relocate with the symbol or with the section and we would then
9 // not produce a relocation with .text.
13 .symver defined3, bar5@@@zed
21 // CHECK-NEXT: Name: .text
22 // CHECK-NEXT: Type: SHT_PROGBITS
23 // CHECK-NEXT: Flags [
24 // CHECK-NEXT: SHF_ALLOC
25 // CHECK-NEXT: SHF_EXECINSTR
27 // CHECK-NEXT: Address: 0x0
28 // CHECK-NEXT: Offset: 0x40
29 // CHECK-NEXT: Size: 4
30 // CHECK-NEXT: Link: 0
31 // CHECK-NEXT: Info: 0
32 // CHECK-NEXT: AddressAlignment: 4
33 // CHECK-NEXT: EntrySize: 0
34 // CHECK-NEXT: Relocations [
37 // CHECK-NEXT: Section {
38 // CHECK-NEXT: Index: 2
39 // CHECK-NEXT: Name: .rela.text (1)
40 // CHECK-NEXT: Type: SHT_RELA (0x4)
41 // CHECK-NEXT: Flags [ (0x0)
43 // CHECK-NEXT: Address: 0x0
44 // CHECK-NEXT: Offset: 0x320
45 // CHECK-NEXT: Size: 24
46 // CHECK-NEXT: Link: 6
47 // CHECK-NEXT: Info: 1
48 // CHECK-NEXT: AddressAlignment: 8
49 // CHECK-NEXT: EntrySize: 24
50 // CHECK-NEXT: Relocations [
51 // CHECK-NEXT: 0x0 R_X86_64_32 .text 0x0
56 // Symbol 2 is section 1
58 // CHECK: Name: .text (0)
59 // CHECK-NEXT: Value: 0x0
60 // CHECK-NEXT: Size: 0
61 // CHECK-NEXT: Binding: Local
62 // CHECK-NEXT: Type: Section
63 // CHECK-NEXT: Other: 0
64 // CHECK-NEXT: Section: .text (0x1)