[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / sections-sort.s
blobe665c9aaa74a240debc7f9154053903bd785f956
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
4 # RUN: echo "SECTIONS { .text : {*(.text)} foo : {*(foo)}}" > %t.script
5 # RUN: ld.lld --hash-style=sysv -o %t --script %t.script %t.o -shared
6 # RUN: llvm-objdump --section-headers %t | FileCheck %s
8 # Test the section order. This is a case where at least with libstdc++'s
9 # stable_sort we used to get a different result.
11 nop
13 .section foo, "a"
14 .byte 0
16 # CHECK: Idx
17 # CHECK-NEXT: 0
18 # CHECK-NEXT: 1 .text
19 # CHECK-NEXT: 2 .dynsym
20 # CHECK-NEXT: 3 .hash
21 # CHECK-NEXT: 4 .dynstr
22 # CHECK-NEXT: 5 foo
23 # CHECK-NEXT: 6 .dynamic
24 # CHECK-NEXT: 7 .comment
25 # CHECK-NEXT: 8 .symtab
26 # CHECK-NEXT: 9 .shstrtab
27 # CHECK-NEXT: 10 .strtab