From 33a301baa7503a6958aeab8c7de16f02c6ad4468 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Tue, 30 Apr 2002 09:23:14 +0000 Subject: [PATCH] * ld-scripts/map-address.exp: New test. * ld-scripts/map-address.[td]: New files for it. --- ld/testsuite/ChangeLog | 5 ++++ ld/testsuite/ld-scripts/map-address.d | 10 +++++++ ld/testsuite/ld-scripts/map-address.exp | 37 +++++++++++++++++++++++++ ld/testsuite/ld-scripts/map-address.t | 9 ++++++ 4 files changed, 61 insertions(+) create mode 100644 ld/testsuite/ld-scripts/map-address.d create mode 100644 ld/testsuite/ld-scripts/map-address.exp create mode 100644 ld/testsuite/ld-scripts/map-address.t diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 093ba4d0c9..9cff11e868 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2002-04-30 Richard Sandiford + + * ld-scripts/map-address.exp: New test. + * ld-scripts/map-address.[td]: New files for it. + 2002-04-19 Richard Henderson * 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 index 0000000000..da377c42d8 --- /dev/null +++ b/ld/testsuite/ld-scripts/map-address.d @@ -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 index 0000000000..510d5324e0 --- /dev/null +++ b/ld/testsuite/ld-scripts/map-address.exp @@ -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 index 0000000000..8f2dfebe20 --- /dev/null +++ b/ld/testsuite/ld-scripts/map-address.t @@ -0,0 +1,9 @@ +SECTIONS +{ + . = 0x10001; + foo = .; + . += 0x200; + bar = .; + . = ALIGN (4); + frob = .; +} -- 2.34.1