aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobody <>2004-02-23 10:10:03 +0000
committernobody <>2004-02-23 10:10:03 +0000
commit8e7b2cf4286e07d4a8a21e1fa33fc212ddf3f15e (patch)
tree1e7807124762f4a6373bdb9c2351f065dad3bdbc
parentaa59a2adb9d7b0f3b63398d5572f1c50faeaf4a6 (diff)
downloadgdb-8e7b2cf4286e07d4a8a21e1fa33fc212ddf3f15e.zip
gdb-8e7b2cf4286e07d4a8a21e1fa33fc212ddf3f15e.tar.gz
gdb-8e7b2cf4286e07d4a8a21e1fa33fc212ddf3f15e.tar.bz2
This commit was manufactured by cvs2svn to create branch 'binutils-
2_15-branch'. Cherrypick from master 2004-02-23 10:10:02 UTC Nathan Sidwell <nathan@codesourcery.com> ' * ldlang.h (struct lang_output_section_state): Change processed': ld/testsuite/ld-scripts/provide-1.d ld/testsuite/ld-scripts/provide-1.s ld/testsuite/ld-scripts/provide-1.t ld/testsuite/ld-scripts/provide-2.d ld/testsuite/ld-scripts/provide-2.s ld/testsuite/ld-scripts/provide-2.t ld/testsuite/ld-scripts/provide-3.d ld/testsuite/ld-scripts/provide-3.s ld/testsuite/ld-scripts/provide-3.t ld/testsuite/ld-scripts/provide.exp
-rw-r--r--ld/testsuite/ld-scripts/provide-1.d8
-rw-r--r--ld/testsuite/ld-scripts/provide-1.s3
-rw-r--r--ld/testsuite/ld-scripts/provide-1.t11
-rw-r--r--ld/testsuite/ld-scripts/provide-2.d6
-rw-r--r--ld/testsuite/ld-scripts/provide-2.s6
-rw-r--r--ld/testsuite/ld-scripts/provide-2.t10
-rw-r--r--ld/testsuite/ld-scripts/provide-3.d3
-rw-r--r--ld/testsuite/ld-scripts/provide-3.s3
-rw-r--r--ld/testsuite/ld-scripts/provide-3.t11
-rw-r--r--ld/testsuite/ld-scripts/provide.exp25
10 files changed, 86 insertions, 0 deletions
diff --git a/ld/testsuite/ld-scripts/provide-1.d b/ld/testsuite/ld-scripts/provide-1.d
new file mode 100644
index 0000000..bec3982
--- /dev/null
+++ b/ld/testsuite/ld-scripts/provide-1.d
@@ -0,0 +1,8 @@
+#source: provide-1.s
+#ld: -T provide-1.t
+#objdump: -s -j .data
+
+.*: file format .*
+
+Contents of section .data:
+ 0000 (08)?000000(08)? (0c)?000000(0c)? 00000000 ............
diff --git a/ld/testsuite/ld-scripts/provide-1.s b/ld/testsuite/ld-scripts/provide-1.s
new file mode 100644
index 0000000..6395f3a
--- /dev/null
+++ b/ld/testsuite/ld-scripts/provide-1.s
@@ -0,0 +1,3 @@
+ .data
+ .globl foo
+foo: .long 0
diff --git a/ld/testsuite/ld-scripts/provide-1.t b/ld/testsuite/ld-scripts/provide-1.t
new file mode 100644
index 0000000..dd30956
--- /dev/null
+++ b/ld/testsuite/ld-scripts/provide-1.t
@@ -0,0 +1,11 @@
+SECTIONS
+{
+ .data :
+ {
+ LONG (foo)
+ LONG (bar)
+ *(.data)
+ }
+ PROVIDE (foo = .);
+ PROVIDE (bar = .);
+}
diff --git a/ld/testsuite/ld-scripts/provide-2.d b/ld/testsuite/ld-scripts/provide-2.d
new file mode 100644
index 0000000..3b59e32
--- /dev/null
+++ b/ld/testsuite/ld-scripts/provide-2.d
@@ -0,0 +1,6 @@
+#source: provide-2.s
+#ld: -T provide-2.t
+#nm: -B
+0+3 A baz
+0+0 D foo
+
diff --git a/ld/testsuite/ld-scripts/provide-2.s b/ld/testsuite/ld-scripts/provide-2.s
new file mode 100644
index 0000000..6fa93e4
--- /dev/null
+++ b/ld/testsuite/ld-scripts/provide-2.s
@@ -0,0 +1,6 @@
+ .data
+ .globl foo
+foo: .long 0
+
+ .globl baz
+ .long baz
diff --git a/ld/testsuite/ld-scripts/provide-2.t b/ld/testsuite/ld-scripts/provide-2.t
new file mode 100644
index 0000000..f128d5e1
--- /dev/null
+++ b/ld/testsuite/ld-scripts/provide-2.t
@@ -0,0 +1,10 @@
+SECTIONS
+{
+ PROVIDE (foo = 1);
+ PROVIDE (bar = 2);
+ PROVIDE (baz = 3);
+ .data :
+ {
+ *(.data)
+ }
+}
diff --git a/ld/testsuite/ld-scripts/provide-3.d b/ld/testsuite/ld-scripts/provide-3.d
new file mode 100644
index 0000000..1ee38e3
--- /dev/null
+++ b/ld/testsuite/ld-scripts/provide-3.d
@@ -0,0 +1,3 @@
+#source: provide-2.s
+#ld: -T provide-2.t
+#error: symbol defined in linker script and object file
diff --git a/ld/testsuite/ld-scripts/provide-3.s b/ld/testsuite/ld-scripts/provide-3.s
new file mode 100644
index 0000000..6395f3a
--- /dev/null
+++ b/ld/testsuite/ld-scripts/provide-3.s
@@ -0,0 +1,3 @@
+ .data
+ .globl foo
+foo: .long 0
diff --git a/ld/testsuite/ld-scripts/provide-3.t b/ld/testsuite/ld-scripts/provide-3.t
new file mode 100644
index 0000000..f6229d4
--- /dev/null
+++ b/ld/testsuite/ld-scripts/provide-3.t
@@ -0,0 +1,11 @@
+SECTIONS
+{
+ .data :
+ {
+ LONG (foo)
+ LONG (bar)
+ *(.data)
+ }
+ foo = .;
+ bar = .;
+}
diff --git a/ld/testsuite/ld-scripts/provide.exp b/ld/testsuite/ld-scripts/provide.exp
new file mode 100644
index 0000000..0092674
--- /dev/null
+++ b/ld/testsuite/ld-scripts/provide.exp
@@ -0,0 +1,25 @@
+# Test PROVIDE 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.
+
+set testname "provide"
+
+run_dump_test provide-1
+run_dump_test provide-2
+setup_xfail *-*-*
+run_dump_test provide-3