diff options
Diffstat (limited to 'lld/test/ELF/linkerscript/sections-keep.s')
-rw-r--r-- | lld/test/ELF/linkerscript/sections-keep.s | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lld/test/ELF/linkerscript/sections-keep.s b/lld/test/ELF/linkerscript/sections-keep.s index 72837303ec1..0758007e924 100644 --- a/lld/test/ELF/linkerscript/sections-keep.s +++ b/lld/test/ELF/linkerscript/sections-keep.s @@ -1,5 +1,6 @@ # REQUIRES: x86 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/keep.s -o %t2.o ## First check that section "keep" is garbage collected without using KEEP # RUN: echo "SECTIONS { \ @@ -69,6 +70,16 @@ # MIXED2-NEXT: 5 .shstrtab 0000002f 0000000000000000 # MIXED2-NEXT: 6 .strtab 00000012 0000000000000000 +# Check file pattern for kept sections. +# RUN: echo "SECTIONS { \ +# RUN: . = SIZEOF_HEADERS; \ +# RUN: .keep : { KEEP(*2.o(.keep)) } \ +# RUN: }" > %t.script +# RUN: ld.lld --gc-sections -o %t1 --script %t.script %t2.o %t +# RUN: llvm-objdump -s %t1 | FileCheck -check-prefix=FILEMATCH %s +# FILEMATCH: Contents of section .keep: +# FILEMATCH-NEXT: 00e8 41414141 AAAA + .global _start _start: mov temp, %eax |