[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / dynamic-reloc-index.s
blobd6f1e153fa1fe1f2a35a1d18ba06664daaa09de0
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
8 // We used to record the wrong symbol index for this test
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: ]
16 .global foobar
17 foobar:
18 .global zedx
19 zedx:
20 .global _start
21 _start:
22 .quad bar