[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / note-loadaddr.s
blob3a39863a9075a46aa19065fc2f4a65bfabda2ce8
1 // REQUIRES: x86
2 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3 // RUN: echo "SECTIONS { \
4 // RUN: .note.a : AT(0x1000) { *(.note.a) } \
5 // RUN: .note.b : AT(0x2000) { *(.note.b) } \
6 // RUN: }" > %t.script
7 // RUN: ld.lld %t.o --script %t.script -o %t
8 // RUN: llvm-readobj -l %t | FileCheck %s
10 // CHECK: Type: PT_NOTE
11 // CHECK-NEXT: Offset: 0x1000
12 // CHECK-NEXT: VirtualAddress: 0x0
13 // CHECK-NEXT: PhysicalAddress: 0x1000
14 // CHECK-NEXT: FileSize: 8
15 // CHECK-NEXT: MemSize: 8
16 // CHECK-NEXT: Flags [
17 // CHECK-NEXT: PF_R
18 // CHECK-NEXT: ]
19 // CHECK-NEXT: Alignment: 1
20 // CHECK: Type: PT_NOTE
21 // CHECK-NEXT: Offset: 0x1008
22 // CHECK-NEXT: VirtualAddress: 0x8
23 // CHECK-NEXT: PhysicalAddress: 0x2000
24 // CHECK-NEXT: FileSize: 8
25 // CHECK-NEXT: MemSize: 8
26 // CHECK-NEXT: Flags [
27 // CHECK-NEXT: PF_R
28 // CHECK-NEXT: ]
29 // CHECK-NEXT: Alignment: 1
31 .section .note.a, "a", @note
32 .quad 0
34 .section .note.b, "a", @note
35 .quad 0