llvm-project/lld/test/old-elf/linkerscript/symbol-definition-so.test

33 lines
820 B
Plaintext

/*
We test whether we can define symbols in a linker script and have them exported
to the output file symbol table. This test is the same as symbol-definition.test
but make checking in case of shared library linking.
We use the following linker script for this test:
*/
SECTIONS
{
.text : { *(.text) }
MYSTRING = .;
.data : { *(.data) }
}
/*
RUN: yaml2obj -format=elf %p/Inputs/simple-pic.o.yaml -o=%t.o
RUN: lld -flavor old-gnu -target x86_64 -shared -T %s %t.o -o %t.so
RUN: llvm-readobj -s -symbols %t.so | FileCheck -check-prefix CHECKSYMS %s
CHECKSYMS: Name: .data
CHECKSYMS-NEXT: Type: SHT_PROGBITS
CHECKSYMS-NEXT: Flags [
CHECKSYMS-NEXT: SHF_ALLOC
CHECKSYMS-NEXT: SHF_WRITE
CHECKSYMS-NEXT: ]
CHECKSYMS-NEXT: Address: 0x401060
CHECKSYMS: Name: MYSTRING
CHECKSYMS-NEXT: Value: 0x401060
*/