* ld-scripts/map-address.exp: New test.
authorRichard Sandiford <rdsandiford@googlemail.com>
Tue, 30 Apr 2002 09:23:14 +0000 (09:23 +0000)
committerRichard Sandiford <rdsandiford@googlemail.com>
Tue, 30 Apr 2002 09:23:14 +0000 (09:23 +0000)
* ld-scripts/map-address.[td]: New files for it.

ld/testsuite/ChangeLog
ld/testsuite/ld-scripts/map-address.d [new file with mode: 0644]
ld/testsuite/ld-scripts/map-address.exp [new file with mode: 0644]
ld/testsuite/ld-scripts/map-address.t [new file with mode: 0644]

index 093ba4d..9cff11e 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-30  Richard Sandiford  <rsandifo@redhat.com>
+
+       * ld-scripts/map-address.exp: New test.
+       * ld-scripts/map-address.[td]: New files for it.
+
 2002-04-19  Richard Henderson  <rth@redhat.com>
 
        * ld-elfvsb/elfvsb.exp: Mirror ia64 non-pic xfails for alpha.
diff --git a/ld/testsuite/ld-scripts/map-address.d b/ld/testsuite/ld-scripts/map-address.d
new file mode 100644 (file)
index 0000000..da377c4
--- /dev/null
@@ -0,0 +1,10 @@
+#...
+Linker script and memory map
+
+ *0x0*010001 *\. = 0x10001
+ *0x0*010001 *foo = \.
+ *0x0*010201 *\. = \(\. \+ 0x200\)
+ *0x0*010201 *bar = \.
+ *0x0*010204 *\. = ALIGN \(0x4\)
+ *0x0*010204 *frob = \.
+#pass
diff --git a/ld/testsuite/ld-scripts/map-address.exp b/ld/testsuite/ld-scripts/map-address.exp
new file mode 100644 (file)
index 0000000..510d532
--- /dev/null
@@ -0,0 +1,37 @@
+# Test address printed by --print-map
+# Copyright 2002 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 "map addresses"
+
+# The source file doesn't matter.  Pinch one from the sizeof test.
+if ![ld_assemble $as $srcdir/$subdir/sizeof.s tmpdir/map-address.o] {
+    unresolved $testname
+    return
+}
+
+if ![ld_simple_link $ld tmpdir/map-address \
+        "-T $srcdir/$subdir/map-address.t \
+         tmpdir/map-address.o \
+         -Map tmpdir/map-address.map"] {
+    fail $testname
+} elseif [regexp_diff \
+           "tmpdir/map-address.map" \
+           "$srcdir/$subdir/map-address.d"] {
+    fail $testname
+} else {
+    pass $testname
+}
diff --git a/ld/testsuite/ld-scripts/map-address.t b/ld/testsuite/ld-scripts/map-address.t
new file mode 100644 (file)
index 0000000..8f2dfeb
--- /dev/null
@@ -0,0 +1,9 @@
+SECTIONS
+{
+  . = 0x10001;
+  foo = .;
+  . += 0x200;
+  bar = .;
+  . = ALIGN (4);
+  frob = .;
+}