llvm-project/lld/test/ELF/linkerscript/quoted-section-name.test
Fangrui Song d60ef9338d [ELF] Support quoted output section names
Similar to e7a7ad134fe182aad190cb3ebc441164470e92f5 and
2bf06d9345caeb26520be8e830c092683bbdf0f7 for other linker script syntax.

Close https://github.com/llvm/llvm-project/issues/60496
2023-02-03 11:03:00 -08:00

22 lines
571 B
Plaintext

# REQUIRES: x86
## Handling of quotes is tricky sometimes. Check we do that right and include
## "foo bar" section into ".data foo" as expected.
# RUN: echo '.section "foo bar", "aw"; nop' | llvm-mc -filetype=obj -triple=x86_64 - -o %t.o
# RUN: ld.lld %t.o --script %s -o %t --print-map | FileCheck %s
# RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SEC
# CHECK: .data foo
# CHECK-NEXT: {{.*}}(foo bar)
# SEC: ]{{ }}.data foo
# SEC: ]{{ }}.data bar
SECTIONS {
" .data foo" : { *("foo bar") }
}
OVERWRITE_SECTIONS {
" .data bar" : { bar = .; }
}