brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 9620412 Raw
47 lines · plain
1// REQUIRES: x862/// Link against a DSO to ensure that sections are not discarded by --gc-sections.3// RUN: llvm-mc -filetype=obj -triple=x86_64 %S/Inputs/shared.s -o %ts.o4// RUN: ld.lld -shared -soname=ts %ts.o -o %ts.so5// RUN: llvm-mc %s -o %t.o -filetype=obj --triple=x86_64-unknown-linux6// RUN: ld.lld %t.o %ts.so -o %t --export-dynamic --gc-sections7// RUN: llvm-readelf -S %t | FileCheck --implicit-check-not=has_startstop %s8 9// We can't let the has_startstop section be split by partition because it is10// referenced by __start_ and __stop_ symbols, so the split could result in11// some sections being moved out of the __start_/__stop_ range. Make sure that12// that didn't happen by checking that there is only one section.13//14// It's fine for us to split no_startstop because of the lack of15// __start_/__stop_ symbols.16 17// CHECK: has_startstop18// CHECK: no_startstop19 20// CHECK: no_startstop21 22.section .llvm_sympart.f1,"",@llvm_sympart23.asciz "part1"24.quad f125 26.section .text._start,"ax",@progbits27.globl _start28_start:29call __start_has_startstop30call __stop_has_startstop31 32.section .text.f1,"ax",@progbits33.globl f134f1:35 36.section has_startstop,"ao",@progbits,.text._start,unique,137.quad 138 39.section has_startstop,"ao",@progbits,.text.f1,unique,240.quad 241 42.section no_startstop,"ao",@progbits,.text._start,unique,143.quad 344 45.section no_startstop,"ao",@progbits,.text.f1,unique,246.quad 447