summaryrefslogtreecommitdiff
path: root/binutils/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2012-02-01 15:44:29 +0000
committerNick Clifton <nickc@redhat.com>2012-02-01 15:44:29 +0000
commitbd69c0baee716db05c1cd0004eb5673d78f945ef (patch)
treef951af0bab07d7d8cdcc99ea0c9db0be3931cdfd /binutils/testsuite
parentbde158875201e8368142d3cdfeb82489976738a9 (diff)
downloadbinutils-redhat-bd69c0baee716db05c1cd0004eb5673d78f945ef.tar.gz
PR binutils/13482
* readelf.c (process_corefile_note_segment): Fix off-by-one errors verifying the contents of a note. * binutils-all/version.s: New test source file. * binutils-all/readelf.n: New file: expected readelf output. * binutils-all/readelf.exp: Add test of .note section contents.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/ChangeLog6
-rw-r--r--binutils/testsuite/binutils-all/readelf.exp17
2 files changed, 22 insertions, 1 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 277571951a..ecf56b8bdf 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-01 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/13482
+ * binutils-all/version.s: New test source file.
+ * binutils-all/readelf.n: New file: expected readelf output.
+ * binutils-all/readelf.exp: Add test of .note section contents.
For older changes see ChangeLog-0411
diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp
index 8b68aececd..e611cb2cdd 100644
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000, 2001, 2003, 2004, 2007, 2009
+# Copyright 1999, 2000, 2001, 2003, 2004, 2007, 2009, 2012
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -337,3 +337,18 @@ readelf_wi_test
readelf_compressed_wa_test
readelf_dump_test
+
+# PR 13482 - Check for off-by-one errors when dumping .note sections.
+if {![binutils_assemble $srcdir/$subdir/version.s tmpdir/version.o]} then {
+ perror "could not assemble version note test file"
+ unresolved "readelf - failed to assemble"
+ return
+}
+
+if ![is_remote host] {
+ set tempfile tmpdir/version.o
+} else {
+ set tempfile [remote_download host tmpdir/version.o]
+}
+
+readelf_test -n $tempfile readelf.n {}