2 // RUN
: llvm-mc
-filetype
=obj
-triple x86_64-pc-linux-gnu
%s
-o
%t.o
3 // RUN
: echo
"SECTIONS { . = SIZEOF_HEADERS; .text : { *(.text) } }" > %t.script
4 // RUN
: ld.lld
-T %t.script
%t.o
-o
%t
5 // RUN
: llvm-readobj
--symbols
%t | FileCheck
%s
7 // Test that _start is in the correct section.
10 // CHECK-NEXT
: Size
: 0
11 // CHECK-NEXT
: Binding
: Global
12 // CHECK-NEXT
: Type
: None
13 // CHECK-NEXT
: Other
: 0
14 // CHECK-NEXT
: Section
: dn
16 // Show that
--gc-sections works when there are many sections
, and that
17 // referenced common
and absolute symbols in such cases are
not removed
, nor are
18 // they incorrectly attributed to the sections with index
0xFFF1 or 0xFFF2.
19 // RUN
: ld.lld
%t.o
-T %t.script
-o
%t --gc-sections
20 // RUN
: llvm-readobj
--symbols
--sections
%t | FileCheck
%s
--check-prefix
=GC
31 // GC-NEXT
: Name
: .bss
34 // GC-NEXT
: Name
: .comment
37 // GC-NEXT
: Name
: .symtab
40 // GC-NEXT
: Name
: .shstrtab
43 // GC-NEXT
: Name
: .strtab
54 // GC-NEXT
: Name
: common
56 // GC-NEXT
: Name
: _start
59 .macro gen_sections4 x
74 .macro gen_sections8 x
79 .macro gen_sections16 x
84 .macro gen_sections32 x
89 .macro gen_sections64 x
94 .macro gen_sections128 x
99 .macro gen_sections256 x
104 .macro gen_sections512 x
109 .macro gen_sections1024 x
114 .macro gen_sections2048 x
119 .macro gen_sections4096 x
124 .macro gen_sections8192 x
129 .macro gen_sections16384 x
134 .macro gen_sections32768 x
135 gen_sections16384
a\x
136 gen_sections16384
b\x