36 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o3# RUN: echo "SECTIONS { .foo : { *(.foo) } .bar : { *(.got.plt) BYTE(0x11) }}" > %t.script4# RUN: ld.lld -o %t --script %t.script %t.o5# RUN: llvm-readobj -S %t | FileCheck %s6 7## We have ".got.plt" synthetic section with SHF_ALLOC|SHF_WRITE flags.8## It is empty, so linker removes it, but it has to keep ".got.plt" output9## section because of the BYTE command. Here we check that the output section10## still remembers what the flags of .got.plt are.11 12# CHECK: Section {13# CHECK: Index: 214# CHECK: Name: .bar15# CHECK-NEXT: Type: SHT_PROGBITS16# CHECK-NEXT: Flags [17# CHECK-NEXT: SHF_ALLOC18# CHECK-NEXT: SHF_WRITE19# CHECK-NEXT: ]20 21## Check flags are not the same if we omit empty synthetic section in script.22# RUN: echo "SECTIONS { .foo : { *(.foo) } .bar : { BYTE(0x11) }}" > %t.script23# RUN: ld.lld -o %t --script %t.script %t.o24# RUN: llvm-readobj -S %t | FileCheck --check-prefix=EMPTY %s25 26# EMPTY: Section {27# EMPTY: Index: 228# EMPTY: Name: .bar29# EMPTY-NEXT: Type: SHT_PROGBITS30# EMPTY-NEXT: Flags [31# EMPTY-NEXT: SHF_ALLOC32# EMPTY-NEXT: ]33 34.section .foo,"ax"35.quad 036