29 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o3# RUN: echo "SECTIONS { \4# RUN: .got : { *(.got) *(.got) } \5# RUN: .plt : { *(.plt) } \6# RUN: .text : { *(.text) } \7# RUN: }" > %t.script8# RUN: ld.lld -shared -o %t.so --script %t.script %t.o9 10# RUN: llvm-readelf -S %t.so | FileCheck %s11# CHECK-NOT: .got12# CHECK-NOT: .plt13# CHECK: .dynsym14# CHECK: .text15 16# Test that the size of a removed unused synthetic input section is not added17# to the output section size. Adding a symbol assignment prevents removal of18# the output section, but does not cause the section size to be recomputed.19# RUN: echo "SECTIONS { \20# RUN: .got.plt : { a_sym = .; *(.got.plt) } \21# RUN: }" > %t2.script22# RUN: ld.lld -shared -o %t2.so --script %t2.script %t.o23# RUN: llvm-objdump --section-headers %t2.so | FileCheck %s --check-prefix=CHECK224# CHECK2: .got.plt 0000000025 26.global _start27_start:28 nop29