aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-09-10 12:11:28 +0000
committerNick Clifton <nickc@redhat.com>2010-09-10 12:11:28 +0000
commitb7dd81f7c52b52ab6a05c4858afa5da5fcc5c260 (patch)
tree3153c808752aac03e875198ca430b7d532debe46 /binutils/testsuite
parentfca41f0f7244d3a0782151bd0730aeb74b8ee743 (diff)
downloadgdb-b7dd81f7c52b52ab6a05c4858afa5da5fcc5c260.zip
gdb-b7dd81f7c52b52ab6a05c4858afa5da5fcc5c260.tar.gz
gdb-b7dd81f7c52b52ab6a05c4858afa5da5fcc5c260.tar.bz2
* objcopy.c: Add --interleave-width option to allow interleaving
of more than one byte at a time. (copy_width): New variable. (copy_options): Add --interleave-width. (copy_section): When interleaving copy in units of copy_width bytes. (copy_main): Parse the new option. * doc/binutils: Document the new option. * NEWS: Mention the new feature. * binutils-all/objcopy.exp: Add test of new --interleave-width option.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r--binutils/testsuite/ChangeLog5
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp39
2 files changed, 43 insertions, 1 deletions
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 9e5e22d..93c4937 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-09-10 Ben Gardiner <bengardiner@nanometrics.ca>
+
+ * binutils-all/objcopy.exp: Add test of new --interleave-width
+ option.
+
2010-09-03 Jan Kratochvil <jan.kratochvil@redhat.com>
* binutils-all/objdump.W: Update DW_OP_reg5 expected output.
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index 94a31aa..6bfd164 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -1,5 +1,5 @@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-# 2004, 2006, 2007, 2009
+# 2004, 2006, 2007, 2009, 2010
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -144,6 +144,43 @@ if ![string match "" $got] then {
}
}
+# Test interleaved copy of multiple byte width
+
+set sequence_file sequence_file
+set file [open ${sequence_file} w]
+puts ${file} "12345678"
+close ${file}
+
+if [is_remote host] {
+ remote_upload host ${sequence_file} tmpdir/sequence_file
+ set sequence_file tmpdir/sequence_file
+}
+
+set got [binutils_run $OBJCOPY "-I binary -i 4 -b 0 --interleave-width 2 ${sequence_file} ${copyfile}"]
+
+if ![string match "" $got] then {
+ fail "objcopy -i --interleave-width"
+} else {
+ if [is_remote host] {
+ remote_upload host ${copyfile} tmpdir/interleave_output
+ set interleave_output tmpdir/interleave_output
+ } else {
+ set interleave_output ${copyfile}
+ }
+
+ set file [open ${interleave_output} r]
+ gets $file line
+ send_log "$line\n"
+ verbose $line
+
+ if ![string match "1256" $line] then {
+ fail "objcopy -i --interleave-width"
+ }
+ pass "objcopy -i --interleave-width"
+
+ close $file
+}
+
# Test generating S records.
# We make the srec filename 8.3 compatible. Note that the header string