summaryrefslogtreecommitdiff
path: root/test/ELF/linkerscript/empty-link-order.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/ELF/linkerscript/empty-link-order.test')
-rw-r--r--test/ELF/linkerscript/empty-link-order.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ELF/linkerscript/empty-link-order.test b/test/ELF/linkerscript/empty-link-order.test
new file mode 100644
index 0000000000000..b63b60ca8c151
--- /dev/null
+++ b/test/ELF/linkerscript/empty-link-order.test
@@ -0,0 +1,21 @@
+# REQUIRES: arm
+# RUN: llvm-mc -filetype=obj -triple=arm-arm-none-eabi -o %t.o < /dev/null
+
+SECTIONS {
+ .foo : {
+ bar = .;
+ *(.ARM.exidx*)
+ }
+}
+
+# RUN: ld.lld %t.o -o %t --script %s
+
+## Check we do not crash and do not set SHF_LINK_ORDER flag for .foo
+# RUN: llvm-readobj -s %t | FileCheck %s
+# CHECK: Section {
+# CHECK: Index:
+# CHECK: Name: .foo
+# CHECK-NEXT: Type: SHT_ARM_EXIDX
+# CHECK-NEXT: Flags [
+# CHECK-NEXT: SHF_ALLOC
+# CHECK-NEXT: ]