1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -r -t | FileCheck %s 2 3 // Test that the relocations point to the correct symbols. We used to get the 4 // symbol index wrong for weakrefs when creating _GLOBAL_OFFSET_TABLE_. 5 6 .weakref bar,foo 7 call zed@PLT 8 call bar 9 10 // CHECK: Relocations [ 11 // CHECK-NEXT: Section ({{[0-9]+}}) {{[^ ]+}} { 12 // CHECK-NEXT: 0x1 R_X86_64_PLT32 zed 0xFFFFFFFFFFFFFFFC 13 // CHECK-NEXT: 0x6 R_X86_64_PC32 foo 0xFFFFFFFFFFFFFFFC 14 // CHECK-NEXT: } 15 // CHECK-NEXT: ] 16 17 // CHECK: Symbols [ 18 // CHECK: Symbol { 19 // CHECK: Name: _GLOBAL_OFFSET_TABLE_ (9) 20 // CHECK-NEXT: Value: 0x0 21 // CHECK-NEXT: Size: 0 22 // CHECK-NEXT: Binding: Global 23 // CHECK-NEXT: Type: None 24 // CHECK-NEXT: Other: 0 25 // CHECK-NEXT: Section: (0x0) 26 // CHECK-NEXT: } 27 // CHECK-NEXT: Symbol { 28 // CHECK-NEXT: Name: foo (1) 29 // CHECK-NEXT: Value: 0x0 30 // CHECK-NEXT: Size: 0 31 // CHECK-NEXT: Binding: Weak 32 // CHECK-NEXT: Type: None 33 // CHECK-NEXT: Other: 0 34 // CHECK-NEXT: Section: (0x0) 35 // CHECK-NEXT: } 36 // CHECK-NEXT: Symbol { 37 // CHECK-NEXT: Name: zed (5) 38 // CHECK-NEXT: Value: 0x0 39 // CHECK-NEXT: Size: 0 40 // CHECK-NEXT: Binding: Global 41 // CHECK-NEXT: Type: None 42 // CHECK-NEXT: Other: 0 43 // CHECK-NEXT: Section: (0x0) 44 // CHECK-NEXT: } 45