[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / symbol-alias-relocation.s
blob28ee9c795b8adccd963b214f5ece33d807a4d806
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3 # RUN: echo "aliasto__text = __text; SECTIONS { .text 0x1000 : { __text = . ; *(.text) } }" > %t.script
4 # RUN: ld.lld -pie -o %t --script %t.script %t.o
5 # RUN: llvm-readobj --symbols %t | FileCheck %s
7 ## Check that alias 'aliasto__text' has the correct value.
8 ## (It should belong to the section .text and point to it's start).
10 # CHECK: Symbol {
11 # CHECK: Name: aliasto__text
12 # CHECK-NEXT: Value: 0x1000
13 # CHECK-NEXT: Size: 0
14 # CHECK-NEXT: Binding: Global
15 # CHECK-NEXT: Type: None
16 # CHECK-NEXT: Other: 0
17 # CHECK-NEXT: Section: .text
18 # CHECK-NEXT: }
20 # CHECK: Symbol {
21 # CHECK: Name: __text
22 # CHECK-NEXT: Value: 0x1000
23 # CHECK-NEXT: Size: 0
24 # CHECK-NEXT: Binding: Global
25 # CHECK-NEXT: Type: None
26 # CHECK-NEXT: Other: 0
27 # CHECK-NEXT: Section: .text
28 # CHECK-NEXT: }
30 .text
31 .globl _start
32 .type _start, %function
33 _start:
34 .globl aliasto__text
35 call __text
36 call aliasto__text