2 // RUN
: llvm-mc
%s
-o
%t.o
-filetype
=obj
--triple
=x86_64-unknown-linux
3 // RUN
: ld.lld
%t.o
-o
%t --export-dynamic
--gc-sections
4 // RUN
: llvm-readelf
-S
%t | FileCheck
--implicit-check-
not=has_startstop
%s
6 // We can
't let the has_startstop section be split by partition because it is
7 // referenced by __start_ and __stop_ symbols, so the split could result in
8 // some sections being moved out of the __start_/__stop_ range. Make sure that
9 // that didn't happen by checking that there is only one section.
11 // It
's fine for us to split no_startstop because of the lack of
12 // __start_/__stop_ symbols.
14 // CHECK: has_startstop
15 // CHECK: no_startstop
17 // CHECK: no_startstop
19 .section .llvm_sympart.f1,"",@llvm_sympart
23 .section .text._start,"ax",@progbits
26 call __start_has_startstop
27 call __stop_has_startstop
29 .section .text.f1,"ax",@progbits
33 .section has_startstop,"ao",@progbits,.text._start,unique,1
36 .section has_startstop,"ao",@progbits,.text.f1,unique,2
39 .section no_startstop,"ao",@progbits,.text._start,unique,1
42 .section no_startstop,"ao",@progbits,.text.f1,unique,2