aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2010-01-06 16:52:15 +0000
committerH.J. Lu <hjl.tools@gmail.com>2010-01-06 16:52:15 +0000
commit30fd33bb933183e837b6709e189f1122333b95e2 (patch)
tree49af8a2936554dece7892b1366450011e37651e8 /binutils/testsuite
parente3e535bc5863ec5a183bfaabcd5d1d36a129305a (diff)
downloadgdb-30fd33bb933183e837b6709e189f1122333b95e2.zip
gdb-30fd33bb933183e837b6709e189f1122333b95e2.tar.gz
gdb-30fd33bb933183e837b6709e189f1122333b95e2.tar.bz2
Add elfedit
binutils/ 2010-01-06 H.J. Lu <hongjiu.lu@intel.com> PR binutils/11131 * Makefile.am (ELFEDIT_PROG): New. (bin_PROGRAMS): Add $(ELFEDIT_PROG). (CFILES): Add elfedit.c. (elfedit_DEPENDENCIES): New. (elfedit_SOURCES): Likewise. (elfedit_LDADD): Likewise. * Makefile.in: Regenerated. * elfedit.c: New. * doc/binutils.texi: Document elfedit. * doc/Makefile.am (man_MANS): Add elfedit.1. (elfedit.1): New. * doc/Makefile.in: Regenerated. binutils/testsuite/ 2010-01-06 H.J. Lu <hongjiu.lu@intel.com> PR binutils/11131 * binutils-all/elfedit-1.d: New. * binutils-all/elfedit.exp: Likewise. * config/default.exp (ELFEDIT): New. Set if it doesn't exist. (ELFEDITFLAGS): Likewise. * lib/utils-lib.exp (run_dump_test): Support elfedit.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/ChangeLog11
-rw-r--r--binutils/testsuite/binutils-all/elfedit-1.d16
-rw-r--r--binutils/testsuite/binutils-all/elfedit.exp31
-rw-r--r--binutils/testsuite/config/default.exp6
-rw-r--r--binutils/testsuite/lib/utils-lib.exp3
5 files changed, 67 insertions, 0 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 3001daf..bd066e1 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,14 @@
+2010-01-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/11131
+ * binutils-all/elfedit-1.d: New.
+ * binutils-all/elfedit.exp: Likewise.
+
+ * config/default.exp (ELFEDIT): New. Set if it doesn't exist.
+ (ELFEDITFLAGS): Likewise.
+
+ * lib/utils-lib.exp (run_dump_test): Support elfedit.
+
2009-10-28 Kai Tietz <kai.tietz@onevision.com>
* binutils-all/dlltool.exp: Add tests for --no-leading-underscore
diff --git a/binutils/testsuite/binutils-all/elfedit-1.d b/binutils/testsuite/binutils-all/elfedit-1.d
new file mode 100644
index 0000000..3459315
--- /dev/null
+++ b/binutils/testsuite/binutils-all/elfedit-1.d
@@ -0,0 +1,16 @@
+#PROG: elfedit
+#elfedit: --output-mach l1om
+#source: empty.s
+#readelf: -h
+#name: Update ELF header 1
+#target: x86_64-*-*
+
+#...
+ELF Header:
+ Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
+ Class: ELF64
+ Data: 2's complement, little endian
+ Version: 1 \(current\)
+#...
+ Machine: Intel L1OM
+#...
diff --git a/binutils/testsuite/binutils-all/elfedit.exp b/binutils/testsuite/binutils-all/elfedit.exp
new file mode 100644
index 0000000..d43c31a
--- /dev/null
+++ b/binutils/testsuite/binutils-all/elfedit.exp
@@ -0,0 +1,31 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
+# This program 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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Exclude non-ELF targets.
+if ![is_elf_format] {
+ verbose "$ELFEDIT is only intended for ELF targets" 2
+ return
+}
+
+if ![is_remote host] {
+ set tempfile tmpdir/bintest.o
+ set copyfile tmpdir/bintest
+} else {
+ set tempfile [remote_download host tmpdir/bintest.o]
+ set copyfile bintest
+}
+
+run_dump_test "elfedit-1"
diff --git a/binutils/testsuite/config/default.exp b/binutils/testsuite/config/default.exp
index f3fd624..01fd8cc 100644
--- a/binutils/testsuite/config/default.exp
+++ b/binutils/testsuite/config/default.exp
@@ -61,6 +61,12 @@ if ![info exists READELF] then {
if ![info exists READELFFLAGS] then {
set READELFFLAGS ""
}
+if ![info exists ELFEDIT] then {
+ set ELFEDIT [findfile $base_dir/elfedit]
+}
+if ![info exists ELFEDITFLAGS] then {
+ set ELFEDITFLAGS ""
+}
if ![info exists WINDRES] then {
set WINDRES [findfile $base_dir/windres]
}
diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp
index 9881f01..393aae8 100644
--- a/binutils/testsuite/lib/utils-lib.exp
+++ b/binutils/testsuite/lib/utils-lib.exp
@@ -281,6 +281,7 @@ proc run_dump_test { name {extra_options {}} } {
global subdir srcdir
global OBJDUMP NM OBJCOPY READELF STRIP
global OBJDUMPFLAGS NMFLAGS OBJCOPYFLAGS READELFFLAGS STRIPFLAGS
+ global ELFEDIT ELFEDITFLAGS
global host_triplet
global env
global copyfile
@@ -309,6 +310,7 @@ proc run_dump_test { name {extra_options {}} } {
set opts(size) {}
set opts(strings) {}
set opts(name) {}
+ set opts(elfedit) {}
set opts(PROG) {}
set opts(DUMPPROG) {}
set opts(source) {}
@@ -372,6 +374,7 @@ proc run_dump_test { name {extra_options {}} } {
set destopt "-o"
}
strings { set program strings }
+ elfedit { set program elfedit }
default {
perror "unrecognized program option $opts(PROG) in $file.d"
unresolved $testname