[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / gc-sections-metadata-startstop.s
blob76134525b4ce5589644940e748a02367a6ee3e45
1 # REQUIRES: x86
2 # LINK_ORDER cnamed sections are not kept alive by the __start_* reference.
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
5 # RUN: ld.lld --gc-sections -z start-stop-gc -z nostart-stop-gc %t.o -o %t
6 # RUN: llvm-objdump --section-headers -t %t | FileCheck %s
8 ## With -z start-stop-gc (default), non-SHF_LINK_ORDER C identifier name
9 ## sections are not retained by __start_/__stop_ references.
10 # RUN: ld.lld --gc-sections %t.o -o %t
11 # RUN: llvm-readelf -S -s %t | FileCheck %s --check-prefix=GC
12 # RUN: ld.lld --gc-sections -z start-stop-gc %t.o -o %t1
13 # RUN: llvm-readelf -S -s %t1 | FileCheck %s --check-prefix=GC
15 # CHECK: Sections:
16 # CHECK-NOT: yy
17 # CHECK: xx {{.*}} DATA
18 # CHECK-NOT: yy
20 # CHECK: SYMBOL TABLE:
21 # CHECK: xx 0000000000000000 .protected __start_xx
22 # CHECK: w *UND* 0000000000000000 __start_yy
24 # GC: Section Headers:
25 # GC-NOT: xx
26 # GC-NOT: yy
28 # GC: WEAK DEFAULT UND __start_xx
29 # GC: WEAK DEFAULT UND __start_yy
31 .weak __start_xx
32 .weak __start_yy
34 .global _start
35 _start:
36 .quad __start_xx
37 .quad __start_yy
39 .section xx,"a"
40 .quad 0
42 .section .foo,"a"
43 .quad 0
45 .section yy,"ao",@progbits,.foo
46 .quad 0