aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-02-19 14:08:31 +0000
committerNathan Sidwell <nathan@codesourcery.com>2004-02-19 14:08:31 +0000
commit384d938fc857ab8529254abf9261c6b57a069a53 (patch)
treef0d349875928d63baa54f7a48f4233b17720313b /ld/testsuite
parenta8a6d7cef4feec69589446caa82f1236e3e3f6d6 (diff)
downloadgdb-384d938fc857ab8529254abf9261c6b57a069a53.zip
gdb-384d938fc857ab8529254abf9261c6b57a069a53.tar.gz
gdb-384d938fc857ab8529254abf9261c6b57a069a53.tar.bz2
* ldlang.c (map_input_to_output_sections): Initialize sections
mentioned in a data statement expression. (lang_do_assignments_1): Add data statement's expression's section's vma. * ld-scripts/data.{s,t,d,exp}: New.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog4
-rw-r--r--ld/testsuite/ld-scripts/data.d9
-rw-r--r--ld/testsuite/ld-scripts/data.exp20
-rw-r--r--ld/testsuite/ld-scripts/data.s1
-rw-r--r--ld/testsuite/ld-scripts/data.t10
5 files changed, 44 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 282ee0c..23e41a9 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2004-02-19 Nathan Sidwell <nathan@codesourcery.com>
+
+ * ld-scripts/data.{s,t,d,exp}: New.
+
2004-02-18 Nathan Sidwell <nathan@codesourcery.com>
* ld-scripts/assert.{s,t,exp}: New.
diff --git a/ld/testsuite/ld-scripts/data.d b/ld/testsuite/ld-scripts/data.d
new file mode 100644
index 0000000..6284686
--- /dev/null
+++ b/ld/testsuite/ld-scripts/data.d
@@ -0,0 +1,9 @@
+#source: data.s
+#ld: -T data.t
+#objdump: -s -j .text
+
+.*: file format .*
+
+Contents of section .text:
+ 1000 (0410)?0000(1004)? (0810)?0000(1008)? +........ *
+#pass
diff --git a/ld/testsuite/ld-scripts/data.exp b/ld/testsuite/ld-scripts/data.exp
new file mode 100644
index 0000000..9cca01a
--- /dev/null
+++ b/ld/testsuite/ld-scripts/data.exp
@@ -0,0 +1,20 @@
+# Test DATA STATEMENT in a linker script.
+# By Nathan Sidwell, CodeSourcery LLC
+# Copyright 2004
+# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+run_dump_test data
diff --git a/ld/testsuite/ld-scripts/data.s b/ld/testsuite/ld-scripts/data.s
new file mode 100644
index 0000000..0517ffe
--- /dev/null
+++ b/ld/testsuite/ld-scripts/data.s
@@ -0,0 +1 @@
+#nothing here
diff --git a/ld/testsuite/ld-scripts/data.t b/ld/testsuite/ld-scripts/data.t
new file mode 100644
index 0000000..359a02f
--- /dev/null
+++ b/ld/testsuite/ld-scripts/data.t
@@ -0,0 +1,10 @@
+SECTIONS
+{
+ .text 0x1000 :
+ {
+ LONG (label)
+ label = .;
+ LONG (ADDR (.other))
+ }
+ .other : {}
+}