[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / merge-sym-gc.s
blob4f83179cc75b5087bf4b88dff44ab04f29ba427f
1 # REQUIRES: x86
2 ## Show how symbols in GCed mergeable pieces behave.
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
5 # RUN: ld.lld --gc-sections %t.o -o %t.elf
6 # RUN: llvm-readelf %t.elf --sections --syms | FileCheck %s
8 .section .rodata.merge,"aM",@progbits,4
9 a1: ## Unreferenced. In first fragment, kept by a2 reference.
10 .short 1
11 a2: ## Referenced.
12 .short 1
13 b1: ## Unreferenced. Discarded as second fragment is unreferenced.
14 .short 1
15 b2: ## Unreferenced. Discarded as second fragment is unreferenced.
16 .short 1
17 c1: ## Referenced.
18 .short 1
19 c2: ## Unreferenced. In third fragment, kept by c1 reference.
20 .short 1
22 .data
23 .global _start
24 _start:
25 .quad a2
26 .quad c1
28 # CHECK: .rodata PROGBITS [[#%x, ADDR:]]
30 # CHECK: Symbol table '.symtab' contains 6 entries:
31 # CHECK-NEXT: Num: Value {{.*}} Ndx Name
32 # CHECK-NEXT: 0: {{.*}} UND{{ *$}}
33 # CHECK-NEXT: 1: {{0*}}[[#ADDR]] {{.*}} a1
34 # CHECK-NEXT: 2: {{0*}}[[#ADDR+2]] {{.*}} a2
35 # CHECK-NEXT: 3: {{0*}}[[#ADDR]] {{.*}} c1
36 # CHECK-NEXT: 4: {{0*}}[[#ADDR+2]] {{.*}} c2
37 # CHECK-NEXT: 5: {{.*}} _start