aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-scripts
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-02 06:39:39 -0800
committerH.J. Lu <hjl.tools@gmail.com>2014-02-02 06:39:39 -0800
commit13075d049d492477dfbf795c305adbab5abb6d81 (patch)
tree61ca952b162322ab903b106aa59701562b3b46ab /ld/testsuite/ld-scripts
parent665febb3c8b315c0d00a2a913523fbd6aa2482cf (diff)
downloadgdb-13075d049d492477dfbf795c305adbab5abb6d81.zip
gdb-13075d049d492477dfbf795c305adbab5abb6d81.tar.gz
gdb-13075d049d492477dfbf795c305adbab5abb6d81.tar.bz2
Fix ALIGN_WITH_INPUT
ld/ 2014-02-02 Sebastian Huber <sebastian.huber@embedded-brains.de> * ld/ld.texinfo: Change ALIGN_WITH_INPUT documentation. * ld/ldlang.c (lang_size_sections_1): Add dotdelta variable which reflects the VMA change due to alignment requirements. Use dotdelta do change the LMA if ALIGN_WITH_INPUT is requested. ld/testsuite/ChangeLog 2014-02-02 Sebastian Huber <sebastian.huber@embedded-brains.de> * ld-scripts/rgn-at9.d: New file. * ld-scripts/rgn-at9.t: Likewise. * ld-scripts/rgn-at10.d: Likewise. * ld-scripts/rgn-at10.s: Likewise. * ld-scripts/rgn-at10.t: Likewise. * ld-scripts/rgn-at11.d: Likewise. * ld-scripts/rgn-at11.t: Likewise.
Diffstat (limited to 'ld/testsuite/ld-scripts')
-rw-r--r--ld/testsuite/ld-scripts/rgn-at10.d12
-rw-r--r--ld/testsuite/ld-scripts/rgn-at10.s10
-rw-r--r--ld/testsuite/ld-scripts/rgn-at10.t13
-rw-r--r--ld/testsuite/ld-scripts/rgn-at11.d11
-rw-r--r--ld/testsuite/ld-scripts/rgn-at11.t13
-rw-r--r--ld/testsuite/ld-scripts/rgn-at9.d10
-rw-r--r--ld/testsuite/ld-scripts/rgn-at9.t12
7 files changed, 81 insertions, 0 deletions
diff --git a/ld/testsuite/ld-scripts/rgn-at10.d b/ld/testsuite/ld-scripts/rgn-at10.d
new file mode 100644
index 0000000..73ebfcc
--- /dev/null
+++ b/ld/testsuite/ld-scripts/rgn-at10.d
@@ -0,0 +1,12 @@
+#source: rgn-at10.s
+#ld: -T rgn-at10.t
+#objdump: -h --wide
+#xfail: rx-*-*
+# Test that lma is adjusted in case the section start vma is aligned and
+# lma_region != region if requested by script. Make sure this works with
+# non-load sections.
+
+#...
+.* 0+10000 +0+20000 .*
+.* 0+10100 +0+20100 .*
+.* 0+10100 +0+20100 .*
diff --git a/ld/testsuite/ld-scripts/rgn-at10.s b/ld/testsuite/ld-scripts/rgn-at10.s
new file mode 100644
index 0000000..b538205
--- /dev/null
+++ b/ld/testsuite/ld-scripts/rgn-at10.s
@@ -0,0 +1,10 @@
+ .text
+ .long 0
+
+ .section .tbss,"awT",%nobits
+ .p2align 8
+ .zero 4
+
+ .data
+ .p2align 4
+ .long 0
diff --git a/ld/testsuite/ld-scripts/rgn-at10.t b/ld/testsuite/ld-scripts/rgn-at10.t
new file mode 100644
index 0000000..0aa0b27
--- /dev/null
+++ b/ld/testsuite/ld-scripts/rgn-at10.t
@@ -0,0 +1,13 @@
+MEMORY
+{
+ ram : ORIGIN = 0x10000, LENGTH = 0x10000
+ rom : ORIGIN = 0x20000, LENGTH = 0x10000
+}
+
+SECTIONS
+{
+ .text : ALIGN_WITH_INPUT {*(.text)} > ram AT> rom
+ .tbss : ALIGN_WITH_INPUT {*(.tbss)} > ram AT> rom
+ .data : ALIGN_WITH_INPUT {*(.data)} > ram AT> rom
+ /DISCARD/ : {*(*)}
+}
diff --git a/ld/testsuite/ld-scripts/rgn-at11.d b/ld/testsuite/ld-scripts/rgn-at11.d
new file mode 100644
index 0000000..9ebbd28
--- /dev/null
+++ b/ld/testsuite/ld-scripts/rgn-at11.d
@@ -0,0 +1,11 @@
+#source: rgn-at10.s
+#ld: -T rgn-at11.t
+#objdump: -h --wide
+#xfail: rx-*-*
+# Test that lma is not adjusted in case the section start vma is aligned and
+# lma_region != region if not requested by script.
+
+#...
+.* 0+10000 +0+20000 .*
+.* 0+10100 +0+20004 .*
+.* 0+10100 +0+20004 .*
diff --git a/ld/testsuite/ld-scripts/rgn-at11.t b/ld/testsuite/ld-scripts/rgn-at11.t
new file mode 100644
index 0000000..4f07c9d
--- /dev/null
+++ b/ld/testsuite/ld-scripts/rgn-at11.t
@@ -0,0 +1,13 @@
+MEMORY
+{
+ ram : ORIGIN = 0x10000, LENGTH = 0x10000
+ rom : ORIGIN = 0x20000, LENGTH = 0x10000
+}
+
+SECTIONS
+{
+ .text : ALIGN_WITH_INPUT {*(.text)} > ram AT> rom
+ .tbss : {*(.tbss)} > ram AT> rom
+ .data : ALIGN_WITH_INPUT {*(.data)} > ram AT> rom
+ /DISCARD/ : {*(*)}
+}
diff --git a/ld/testsuite/ld-scripts/rgn-at9.d b/ld/testsuite/ld-scripts/rgn-at9.d
new file mode 100644
index 0000000..e6384b4
--- /dev/null
+++ b/ld/testsuite/ld-scripts/rgn-at9.d
@@ -0,0 +1,10 @@
+#source: rgn-at6.s
+#ld: -T rgn-at9.t
+#objdump: -h --wide
+#xfail: rx-*-*
+# Test that lma is adjusted in case the section start vma is aligned and
+# lma_region != region if requested by script.
+
+#...
+.* 0+10000 +0+20080 .*
+.* 0+10100 +0+20180 .*
diff --git a/ld/testsuite/ld-scripts/rgn-at9.t b/ld/testsuite/ld-scripts/rgn-at9.t
new file mode 100644
index 0000000..7342e64
--- /dev/null
+++ b/ld/testsuite/ld-scripts/rgn-at9.t
@@ -0,0 +1,12 @@
+MEMORY
+{
+ ram : ORIGIN = 0x10000, LENGTH = 0x10000
+ rom : ORIGIN = 0x20080, LENGTH = 0x10000
+}
+
+SECTIONS
+{
+ .text : ALIGN_WITH_INPUT {*(.text)} > ram AT> rom
+ .data : ALIGN_WITH_INPUT {*(.data)} > ram AT> rom
+ /DISCARD/ : {*(*)}
+}