diff options
Diffstat (limited to 'test/ELF/linkerscript/sections.s')
-rw-r--r-- | test/ELF/linkerscript/sections.s | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/test/ELF/linkerscript/sections.s b/test/ELF/linkerscript/sections.s index 2cb9395e6692..1a2323c001dc 100644 --- a/test/ELF/linkerscript/sections.s +++ b/test/ELF/linkerscript/sections.s @@ -66,22 +66,11 @@ # SEC-SWAP-NAMES: 7 .shstrtab 0000003b {{[0-9a-f]*}} # SEC-SWAP-NAMES: 8 .strtab 00000008 {{[0-9a-f]*}} -# .shstrtab from the input object file is discarded. -# RUN: echo "SECTIONS { \ -# RUN: /DISCARD/ : { *(.shstrtab) } }" > %t.script -# RUN: ld.lld -o %t5 --script %t.script %t -# RUN: llvm-objdump -section-headers %t5 | \ +# Attemp to discard .shstrtab section. +# RUN: echo "SECTIONS { /DISCARD/ : { *(.shstrtab) } }" > %t.script +# RUN: not ld.lld -o %t5 --script %t.script %t 2>&1 | \ # RUN: FileCheck -check-prefix=SEC-DISCARD %s - -# Idx Name Size -# SEC-DISCARD: 1 .text 0000000e {{[0-9a-f]*}} TEXT DATA -# SEC-DISCARD: 2 .data 00000020 {{[0-9a-f]*}} DATA -# SEC-DISCARD: 3 other 00000003 {{[0-9a-f]*}} DATA -# SEC-DISCARD: 4 .bss 00000002 {{[0-9a-f]*}} BSS -# SEC-DISCARD: 5 .comment 00000008 {{[0-9a-f]*}} -# SEC-DISCARD: 6 .symtab 00000030 {{[0-9a-f]*}} -# SEC-DISCARD: 7 .shstrtab 0000003b {{[0-9a-f]*}} -# SEC-DISCARD: 8 .strtab 00000008 {{[0-9a-f]*}} +# SEC-DISCARD: discarding .shstrtab section is not allowed # Multiple SECTIONS command specifying additional input section descriptions # for the same output section description - input sections are merged into @@ -104,6 +93,11 @@ # SEC-MULTI: 6 .shstrtab 00000035 {{[0-9a-f]*}} # SEC-MULTI: 7 .strtab 00000008 {{[0-9a-f]*}} +# Input section pattern contains additional semicolon. +# Case found in linux kernel script. Check we are able to parse it. +# RUN: echo "SECTIONS { .text : { ;;*(.text);;S = 0;; } }" > %t.script +# RUN: ld.lld -o /dev/null --script %t.script %t + .globl _start _start: mov $60, %rax |