aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-scripts')
-rw-r--r--ld/testsuite/ld-scripts/empty-address-1.d8
-rw-r--r--ld/testsuite/ld-scripts/empty-address-1.s5
-rw-r--r--ld/testsuite/ld-scripts/empty-address-1.t11
-rw-r--r--ld/testsuite/ld-scripts/empty-address-2.s5
-rw-r--r--ld/testsuite/ld-scripts/empty-address-2a.d8
-rw-r--r--ld/testsuite/ld-scripts/empty-address-2a.t7
-rw-r--r--ld/testsuite/ld-scripts/empty-address-2b.d8
-rw-r--r--ld/testsuite/ld-scripts/empty-address-2b.t11
-rw-r--r--ld/testsuite/ld-scripts/empty-address-3.s5
-rw-r--r--ld/testsuite/ld-scripts/empty-address-3a.d8
-rw-r--r--ld/testsuite/ld-scripts/empty-address-3a.t10
-rw-r--r--ld/testsuite/ld-scripts/empty-address-3b.d8
-rw-r--r--ld/testsuite/ld-scripts/empty-address-3b.t11
-rw-r--r--ld/testsuite/ld-scripts/empty-address-3c.d10
-rw-r--r--ld/testsuite/ld-scripts/empty-address-3c.t11
-rw-r--r--ld/testsuite/ld-scripts/empty-address.exp25
16 files changed, 151 insertions, 0 deletions
diff --git a/ld/testsuite/ld-scripts/empty-address-1.d b/ld/testsuite/ld-scripts/empty-address-1.d
new file mode 100644
index 0000000..8b13014
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-1.d
@@ -0,0 +1,8 @@
+#ld: -T empty-address-1.t
+#nm: -n
+#...
+0+0 T _start
+#...
+0+2000000 A __data_end
+0+2000000 D __data_start
+#pass
diff --git a/ld/testsuite/ld-scripts/empty-address-1.s b/ld/testsuite/ld-scripts/empty-address-1.s
new file mode 100644
index 0000000..c5cc1a5
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-1.s
@@ -0,0 +1,5 @@
+ .text
+ .global _start
+_start:
+ .long __data_start
+ .long __data_end
diff --git a/ld/testsuite/ld-scripts/empty-address-1.t b/ld/testsuite/ld-scripts/empty-address-1.t
new file mode 100644
index 0000000..57a8bed
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-1.t
@@ -0,0 +1,11 @@
+SECTIONS
+{
+ .text 0x0000000: { *(.text) }
+ .data 0x2000000:
+ {
+ __data_start = . ;
+ *(.data)
+ }
+ __data_end = .;
+ /DISCARD/ : { *(.*) }
+}
diff --git a/ld/testsuite/ld-scripts/empty-address-2.s b/ld/testsuite/ld-scripts/empty-address-2.s
new file mode 100644
index 0000000..79f58ea
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-2.s
@@ -0,0 +1,5 @@
+ .text
+ .global _start
+_start:
+ .long __data_end
+ .p2align 4
diff --git a/ld/testsuite/ld-scripts/empty-address-2a.d b/ld/testsuite/ld-scripts/empty-address-2a.d
new file mode 100644
index 0000000..d831d5f
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-2a.d
@@ -0,0 +1,8 @@
+#source: empty-address-2.s
+#ld: -Ttext 0x0000000 -Tdata 0x2000000 -T empty-address-2a.t
+#nm: -n
+#...
+0+0 T _start
+#...
+0+10 A __data_end
+#pass
diff --git a/ld/testsuite/ld-scripts/empty-address-2a.t b/ld/testsuite/ld-scripts/empty-address-2a.t
new file mode 100644
index 0000000..6a40ad8
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-2a.t
@@ -0,0 +1,7 @@
+SECTIONS
+{
+ .text : { *(.text) }
+ .data : { *(.data) }
+ __data_end = .;
+ /DISCARD/ : { *(.*) }
+}
diff --git a/ld/testsuite/ld-scripts/empty-address-2b.d b/ld/testsuite/ld-scripts/empty-address-2b.d
new file mode 100644
index 0000000..514fd68
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-2b.d
@@ -0,0 +1,8 @@
+#source: empty-address-2.s
+#ld: -Ttext 0x0000000 -Tdata 0x2000000 -T empty-address-2b.t
+#nm: -n
+#...
+0+0 T _start
+#...
+0+10 A __data_end
+#pass
diff --git a/ld/testsuite/ld-scripts/empty-address-2b.t b/ld/testsuite/ld-scripts/empty-address-2b.t
new file mode 100644
index 0000000..dcf264f
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-2b.t
@@ -0,0 +1,11 @@
+SECTIONS
+{
+ .text 0x0000000: { *(.text) }
+ .data :
+ {
+ PROVIDE (__data_start = .);
+ *(.data)
+ }
+ __data_end = .;
+ /DISCARD/ : { *(.*) }
+}
diff --git a/ld/testsuite/ld-scripts/empty-address-3.s b/ld/testsuite/ld-scripts/empty-address-3.s
new file mode 100644
index 0000000..6b07dd4
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-3.s
@@ -0,0 +1,5 @@
+ .text
+ .global _start
+_start:
+ .byte 0,0,0,0,0,0,0,0
+ .byte 0,0,0,0,0,0,0,0
diff --git a/ld/testsuite/ld-scripts/empty-address-3a.d b/ld/testsuite/ld-scripts/empty-address-3a.d
new file mode 100644
index 0000000..bb12c80
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-3a.d
@@ -0,0 +1,8 @@
+#source: empty-address-3.s
+#ld: -T empty-address-3a.t
+#nm: -n
+#...
+0+0 T _start
+#...
+0+10 A __data_end
+#pass
diff --git a/ld/testsuite/ld-scripts/empty-address-3a.t b/ld/testsuite/ld-scripts/empty-address-3a.t
new file mode 100644
index 0000000..2807e71
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-3a.t
@@ -0,0 +1,10 @@
+SECTIONS
+{
+ .text 0x00000000: { *(.text) }
+ .data ALIGN(0x1000) + (. & (0x1000 - 1)):
+ {
+ *(.data)
+ }
+ __data_end = .;
+ /DISCARD/ : { *(.*) }
+}
diff --git a/ld/testsuite/ld-scripts/empty-address-3b.d b/ld/testsuite/ld-scripts/empty-address-3b.d
new file mode 100644
index 0000000..b3e2a4b
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-3b.d
@@ -0,0 +1,8 @@
+#source: empty-address-3.s
+#ld: -T empty-address-3b.t
+#nm: -n
+#...
+0+0 T _start
+#...
+0+10 A __data_end
+#pass
diff --git a/ld/testsuite/ld-scripts/empty-address-3b.t b/ld/testsuite/ld-scripts/empty-address-3b.t
new file mode 100644
index 0000000..4f213af
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-3b.t
@@ -0,0 +1,11 @@
+SECTIONS
+{
+ .text 0x00000000: { *(.text) }
+ .data ALIGN(0x1000) + (. & (0x1000 - 1)):
+ {
+ PROVIDE (__data_start = .);
+ *(.data)
+ }
+ __data_end = .;
+ /DISCARD/ : { *(.*) }
+}
diff --git a/ld/testsuite/ld-scripts/empty-address-3c.d b/ld/testsuite/ld-scripts/empty-address-3c.d
new file mode 100644
index 0000000..41e0afb
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-3c.d
@@ -0,0 +1,10 @@
+#source: empty-address-3.s
+#ld: -T empty-address-3c.t
+#nm: -n
+#...
+0+0 T _start
+#...
+0+1010 A __data_end
+#...
+0+1010 D __data_start
+#pass
diff --git a/ld/testsuite/ld-scripts/empty-address-3c.t b/ld/testsuite/ld-scripts/empty-address-3c.t
new file mode 100644
index 0000000..6de5198
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address-3c.t
@@ -0,0 +1,11 @@
+SECTIONS
+{
+ .text 0x00000000: { *(.text) }
+ .data ALIGN(0x1000) + (. & (0x1000 - 1)):
+ {
+ __data_start = .;
+ *(.data)
+ }
+ __data_end = .;
+ /DISCARD/ : { *(.*) }
+}
diff --git a/ld/testsuite/ld-scripts/empty-address.exp b/ld/testsuite/ld-scripts/empty-address.exp
new file mode 100644
index 0000000..556aaba
--- /dev/null
+++ b/ld/testsuite/ld-scripts/empty-address.exp
@@ -0,0 +1,25 @@
+# Make sure that "dot" is updated for empty sections if their addresses
+# are set.
+# Copyright 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+
+run_dump_test empty-address-1
+run_dump_test empty-address-2a
+run_dump_test empty-address-2b
+run_dump_test empty-address-3a
+run_dump_test empty-address-3b
+run_dump_test empty-address-3c