aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-scripts
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2015-01-06 23:40:48 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2015-01-20 09:47:37 +0000
commit43d66c95c826441c64bacfa07095535ddea57a51 (patch)
tree1ff847a2feb4c988aee4811c996237238172f2ad /ld/testsuite/ld-scripts
parent23283c1be02de06666e4d934b1fc499c0d72f9c2 (diff)
downloadgdb-43d66c95c826441c64bacfa07095535ddea57a51.zip
gdb-43d66c95c826441c64bacfa07095535ddea57a51.tar.gz
gdb-43d66c95c826441c64bacfa07095535ddea57a51.tar.bz2
ld/testing: run_dump_test can now check linker mapfiles.
Add a new option 'map' to the ld run_dump_test mechanism. When the 'map' option is given run_dump_test will ensure that there is a -Map=MAPFILE present in the linker command line, adding one if needed. The MAPFILE is then compared with the file passed to the new 'map' option using the regexp_diff function. This should make it slightly easier to write tests that check the linker mapfile output. The only test I found that already compares mapfile content is updated to use the new mechanism. ld/testsuite/ChangeLog: * ld-scripts/overlay-size.d: Add 'map' option. * ld-scripts/overlay-size.exp: Remove manual check of mapfile. * lib/ld-lib.exp (run_dump_test): Add support for new 'map' option, checking linker mapfile output.
Diffstat (limited to 'ld/testsuite/ld-scripts')
-rw-r--r--ld/testsuite/ld-scripts/overlay-size.d1
-rw-r--r--ld/testsuite/ld-scripts/overlay-size.exp9
2 files changed, 1 insertions, 9 deletions
diff --git a/ld/testsuite/ld-scripts/overlay-size.d b/ld/testsuite/ld-scripts/overlay-size.d
index 78a9c92..4e60150 100644
--- a/ld/testsuite/ld-scripts/overlay-size.d
+++ b/ld/testsuite/ld-scripts/overlay-size.d
@@ -1,6 +1,7 @@
# ld: -T overlay-size.t -Map tmpdir/overlay-size.map
# name: overlay size
# objdump: --headers
+# map: overlay-size-map.d
# xfail: rx-*-*
# FAILS on the RX because the linker has to set LMA == VMA for the
# Renesas loader.
diff --git a/ld/testsuite/ld-scripts/overlay-size.exp b/ld/testsuite/ld-scripts/overlay-size.exp
index 4dde289..e8e7a91 100644
--- a/ld/testsuite/ld-scripts/overlay-size.exp
+++ b/ld/testsuite/ld-scripts/overlay-size.exp
@@ -23,12 +23,3 @@ if ![is_elf_format] {
}
run_dump_test overlay-size
-
-set testname "overlay size (map check)"
-
-if [regexp_diff "tmpdir/overlay-size.map" \
- "$srcdir/$subdir/overlay-size-map.d"] {
- fail $testname
-} else {
- pass $testname
-}