diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2002-04-30 09:23:14 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2002-04-30 09:23:14 +0000 |
commit | 33a301baa7503a6958aeab8c7de16f02c6ad4468 (patch) | |
tree | 4b334d28d171840f9ea42e1f17f49ba4290b30ff /ld/testsuite/ld-scripts | |
parent | 7b17f854f7e3bfbd1be0bd3e4ebf99d79a7cf152 (diff) | |
download | gdb-33a301baa7503a6958aeab8c7de16f02c6ad4468.zip gdb-33a301baa7503a6958aeab8c7de16f02c6ad4468.tar.gz gdb-33a301baa7503a6958aeab8c7de16f02c6ad4468.tar.bz2 |
* ld-scripts/map-address.exp: New test.
* ld-scripts/map-address.[td]: New files for it.
Diffstat (limited to 'ld/testsuite/ld-scripts')
-rw-r--r-- | ld/testsuite/ld-scripts/map-address.d | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/map-address.exp | 37 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/map-address.t | 9 |
3 files changed, 56 insertions, 0 deletions
diff --git a/ld/testsuite/ld-scripts/map-address.d b/ld/testsuite/ld-scripts/map-address.d new file mode 100644 index 0000000..da377c4 --- /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 0000000..510d532 --- /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 0000000..8f2dfeb --- /dev/null +++ b/ld/testsuite/ld-scripts/map-address.t @@ -0,0 +1,9 @@ +SECTIONS +{ + . = 0x10001; + foo = .; + . += 0x200; + bar = .; + . = ALIGN (4); + frob = .; +} |