[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / discard-gnu-hash.s
blob9ef2d190a8768c7cfeb31b46e167628417177ca3
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
4 # RUN: ld.lld --hash-style both -shared -o %t %t.o
5 # RUN: llvm-readelf -S -d %t | FileCheck %s
6 # CHECK: .gnu.hash
7 # CHECK: .hash
9 # CHECK: (GNU_HASH)
10 # CHECK: (HASH)
12 # RUN: echo "SECTIONS { /DISCARD/ : { *(.hash) } }" > %t.script
13 # RUN: ld.lld --hash-style both -shared -o %t -T %t.script %t.o
14 # RUN: llvm-readelf -S -d %t | FileCheck %s --check-prefix=HASH
15 # HASH-NOT: .hash
16 # HASH: .gnu.hash
17 # HASH-NOT: .hash
19 # HASH-NOT: (HASH)
20 # HASH: (GNU_HASH)
21 # HASH-NOT: (HASH)
23 # RUN: echo "SECTIONS { /DISCARD/ : { *(.gnu.hash) } }" > %t.script
24 # RUN: ld.lld --hash-style both -shared -o %t -T %t.script %t.o
25 # RUN: llvm-readelf -S -d %t | FileCheck %s --check-prefix=GNUHASH
26 # GNUHASH-NOT: .gnu.hash
27 # GNUHASH: .hash
28 # GNUHASH-NOT: .gnu.hash
30 # GNUHASH-NOT: (GNU_HASH)
31 # GNUHASH: (HASH)
32 # GNUHASH-NOT: (GNU_HASH)