summaryrefslogtreecommitdiffstats
path: root/lld/test/ELF/linkerscript/memory5.test
diff options
context:
space:
mode:
Diffstat (limited to 'lld/test/ELF/linkerscript/memory5.test')
-rw-r--r--lld/test/ELF/linkerscript/memory5.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/lld/test/ELF/linkerscript/memory5.test b/lld/test/ELF/linkerscript/memory5.test
new file mode 100644
index 00000000000..150ddf0e833
--- /dev/null
+++ b/lld/test/ELF/linkerscript/memory5.test
@@ -0,0 +1,19 @@
+# REQUIRES: x86
+# RUN: echo ".section .text,\"ax\"; nop; .section .data,\"aw\"; nop;" \
+# RUN: | llvm-mc -filetype=obj -triple=x86_64-pc-linux - -o %t.o
+# RUN: ld.lld -o %t.so --script %s %t.o
+# RUN: llvm-objdump -section-headers %t.so | FileCheck %s
+
+# CHECK: 1 .text 00000001 0000000000042000
+# CHECK-NEXT: 2 .data 00000001 0000000000044001
+
+## Test that assign to Dot changes the position in a memory region.
+
+MEMORY {
+ ram (wxa) : ORIGIN = 0x42000, LENGTH = 0x100000
+}
+SECTIONS {
+ .text : { *(.text*) }
+ . += 0x2000;
+ .data : { *(.data*) }
+}
OpenPOWER on IntegriCloud