diff options
author | George Rimar <grimar@accesssoftek.com> | 2018-03-13 15:47:14 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2018-03-13 15:47:14 +0000 |
commit | cfd2c97008337193e3ae8a44b2eaae46849f5a96 (patch) | |
tree | 3eb0ba2664c706998b5af9dceb4ab9c2cbd28c60 /lld/test/ELF/linkerscript/implicit-program-header.s | |
parent | d5ae61d49d5bb8f8af07fee043dfc0da4cdd3137 (diff) | |
download | bcm5719-llvm-cfd2c97008337193e3ae8a44b2eaae46849f5a96.tar.gz bcm5719-llvm-cfd2c97008337193e3ae8a44b2eaae46849f5a96.zip |
[ELF] - Represent tests as linker scripts instead of asm.
This follows recently started direction and sometimes
allows to fully get rid from `echo` calls.
I'll rename changed files to *.test in a follow-up.
llvm-svn: 327410
Diffstat (limited to 'lld/test/ELF/linkerscript/implicit-program-header.s')
-rw-r--r-- | lld/test/ELF/linkerscript/implicit-program-header.s | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lld/test/ELF/linkerscript/implicit-program-header.s b/lld/test/ELF/linkerscript/implicit-program-header.s index 682f2024558..ea5c8738d83 100644 --- a/lld/test/ELF/linkerscript/implicit-program-header.s +++ b/lld/test/ELF/linkerscript/implicit-program-header.s @@ -1,15 +1,9 @@ # REQUIRES: x86 -# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -# RUN: echo "PHDRS { \ -# RUN: ph_write PT_LOAD FLAGS(2); \ -# RUN: ph_exec PT_LOAD FLAGS(1); \ -# RUN: } \ -# RUN: SECTIONS { \ -# RUN: .bar : { *(.bar) } : ph_exec \ -# RUN: .foo : { *(.foo) } \ -# RUN: .text : { *(.text) } : ph_write \ -# RUN: }" > %t.script -# RUN: ld.lld --hash-style=sysv -o %t1 --script %t.script \ + +# RUN: echo '.section .text,"ax"; .quad 0' > %t.s +# RUN: echo '.section .foo,"ax"; .quad 0' >> %t.s +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %t.s -o %t.o +# RUN: ld.lld --hash-style=sysv -o %t1 --script %s \ # RUN: %t.o -shared # RUN: llvm-readobj -elf-output-style=GNU -l %t1 | FileCheck %s @@ -17,6 +11,13 @@ # CHECK-NEXT: 00 .text .dynsym .hash .dynstr .dynamic # CHECK-NEXT: 01 .bar .foo -.quad 0 -.section .foo,"ax" -.quad 0 +PHDRS { + ph_write PT_LOAD FLAGS(2); + ph_exec PT_LOAD FLAGS(1); +} + +SECTIONS { + .bar : { *(.bar) } : ph_exec + .foo : { *(.foo) } + .text : { *(.text) } : ph_write +} |