From b7dd81f7c52b52ab6a05c4858afa5da5fcc5c260 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 10 Sep 2010 12:11:28 +0000 Subject: * 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. --- binutils/testsuite/ChangeLog | 5 ++++ binutils/testsuite/binutils-all/objcopy.exp | 39 ++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) (limited to 'binutils/testsuite') 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 + + * binutils-all/objcopy.exp: Add test of new --interleave-width + option. + 2010-09-03 Jan Kratochvil * 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 -- cgit v1.1