diff options
Diffstat (limited to 'test/elf/linkerscript/sections-order.test')
-rw-r--r-- | test/elf/linkerscript/sections-order.test | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/test/elf/linkerscript/sections-order.test b/test/elf/linkerscript/sections-order.test deleted file mode 100644 index 85a172cb07ad..000000000000 --- a/test/elf/linkerscript/sections-order.test +++ /dev/null @@ -1,97 +0,0 @@ -/* -Tests a simple linker script that changes the order of output sections and -also changes the address of output sections by using simple expressions. - -This test uses three X86-64 input objects, prog1.o, prog2.o and prog3.o, -which were created with the following C or assembly code: - -*** prog1.o: - -(command line clang -c prog1.c -o prog1.o) - -const char *prog2(); -void write(int, const char *, int); - -int main() { - write(1, prog2(), 14); -} - -*** prog2.o: - -(command line clang -c prog2.c -o prog2.o) - -const char *prog2() { - return "Hello, world!\n"; -} - -*** prog3.o: - -(command line clang -c prog3.S -o prog3.o) - - .globl write -write: - mov $1, %eax - syscall - ret - - .globl _start -_start: - call main - mov $60, %eax - syscall - ret - -We use the following linker script for this test: -*/ - -ENTRY(_start) - -SECTIONS -{ - . = 0x500000; - .text : { prog1.o(.text) } - .mystring : { prog2.o(.rodata.str1.1) } - . = . + 0x6000; - .text.2 : {prog3.o(.text) prog2.o(.text) } -} - -/* -RUN: mkdir -p %T -RUN: yaml2obj -format=elf %p/Inputs/prog1.o.yaml -o=%T/prog1.o -RUN: yaml2obj -format=elf %p/Inputs/prog2.o.yaml -o=%T/prog2.o -RUN: yaml2obj -format=elf %p/Inputs/prog3.o.yaml -o=%T/prog3.o -RUN: cd %T - -RUN: lld -flavor gnu -target x86_64 -T %s prog1.o prog2.o prog3.o \ -RUN: -static -o %t1 -RUN: llvm-readobj -s %t1 | FileCheck -check-prefix CHECKSECTIONS %s - -CHECKSECTIONS: Index: 1 -CHECKSECTIONS: Name: .text -CHECKSECTIONS: Address: 0x500000 -CHECKSECTIONS: Size: 33 - -CHECKSECTIONS: Index: 2 -CHECKSECTIONS: Name: .mystring -CHECKSECTIONS: Address: 0x500021 -CHECKSECTIONS: Size: 15 - -CHECKSECTIONS: Index: 3 -CHECKSECTIONS: Name: .text.2 -CHECKSECTIONS: Address: 0x506030 -CHECKSECTIONS: Size: 48 - -RUN: llvm-readobj -symbols %t1 | FileCheck -check-prefix CHECKSYMS %s - -CHECKSYMS: Name: main -CHECKSYMS-NEXT: Value: 0x500000 - -CHECKSYMS: Name: write -CHECKSYMS-NEXT: Value: 0x506030 - -CHECKSYMS: Name: _start -CHECKSYMS-NEXT: Value: 0x506038 - -CHECKSYMS: Name: prog2 -CHECKSYMS-NEXT: Value: 0x506050 -*/ |