[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / sizeofheaders.s
blobc01ab23dca8184ec8837952d8621fa69a8f0680e
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3 # RUN: echo " SECTIONS { \
4 # RUN: . = SIZEOF_HEADERS; \
5 # RUN: _size = SIZEOF_HEADERS; \
6 # RUN: .text : {*(.text*)} \
7 # RUN: }" > %t.script
8 # RUN: ld.lld -o %t --script %t.script %t.o
9 # RUN: llvm-readelf -s %t | FileCheck %s
11 # CHECK: Value Size Type Bind Vis Ndx Name
12 # CHECK: 0000000000000120 0 NOTYPE GLOBAL DEFAULT 1 _start
13 # CHECK-NEXT: 0000000000000120 0 NOTYPE GLOBAL DEFAULT ABS _size
15 .global _start
16 _start:
17 nop