1// REQUIRES: x86
2// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/shared.s -o %t2.o
4// RUN: ld.lld -shared %t2.o -o %t2.so
5// RUN: ld.lld %t.o %t2.so -o %t
6// RUN: llvm-readobj -r %t | FileCheck %s
7
8// We used to record the wrong symbol index for this test
9
10// CHECK:      Relocations [
11// CHECK-NEXT:   Section ({{.*}}) .rela.plt {
12// CHECK-NEXT:     {{.*}} R_X86_64_JUMP_SLOT bar 0x0
13// CHECK-NEXT:   }
14// CHECK-NEXT: ]
15
16        .global foobar
17foobar:
18        .global zedx
19zedx:
20        .global _start
21_start:
22.quad bar
23