aboutsummaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
diff options
context:
space:
mode:
authorJamey Hicks <jamey.hicks@gmail.com>2019-05-14 10:40:04 +0100
committerNick Clifton <nickc@redhat.com>2019-05-14 10:42:25 +0100
commit37d0d09177dc02e0002ab8b90d9b7bc402af9240 (patch)
tree637533c2e254a181fb4fdceced99cf406e952936 /binutils/objcopy.c
parent3076e59490428c9719765f9b007d6d0d0238f006 (diff)
downloadgdb-37d0d09177dc02e0002ab8b90d9b7bc402af9240.zip
gdb-37d0d09177dc02e0002ab8b90d9b7bc402af9240.tar.gz
gdb-37d0d09177dc02e0002ab8b90d9b7bc402af9240.tar.bz2
Add new option to objcopy: --verilog-data-width. Use this option to set the size of byte bundles generated in verilog format files.
PR 19921 binutils* objcopy.c: Add new option --verilog-data-width. Use it to set the value of VerilogDataWidth. * doc/binutils.texi: Document the new option. * testsuite/binutils-all/objcopy.exp: Run tests of new option. * testsuite/binutils-all/verilog-1.hex: New file. * testsuite/binutils-all/verilog-2.hex: New file. * testsuite/binutils-all/verilog-4.hex: New file. * testsuite/binutils-all/verilog-8.hex: New file. * NEWS: Mention the new feature. bfd * verilog.c: (VerilogDataWidth): New variable. (verilog_write_record): Emit bytes in VerilogDataWidth bundles.
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r--binutils/objcopy.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 673e1f6..28b9d3b 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -357,6 +357,7 @@ enum command_line_switch
OPTION_STRIP_UNNEEDED_SYMBOLS,
OPTION_SUBSYSTEM,
OPTION_UPDATE_SECTION,
+ OPTION_VERILOG_DATA_WIDTH,
OPTION_WEAKEN,
OPTION_WEAKEN_SYMBOLS,
OPTION_WRITABLE_TEXT
@@ -493,6 +494,7 @@ static struct option copy_options[] =
{"target", required_argument, 0, 'F'},
{"update-section", required_argument, 0, OPTION_UPDATE_SECTION},
{"verbose", no_argument, 0, 'v'},
+ {"verilog-data-width", required_argument, 0, OPTION_VERILOG_DATA_WIDTH},
{"version", no_argument, 0, 'V'},
{"weaken", no_argument, 0, OPTION_WEAKEN},
{"weaken-symbol", required_argument, 0, 'W'},
@@ -519,6 +521,11 @@ extern unsigned int _bfd_srec_len;
on by the --srec-forceS3 command line switch. */
extern bfd_boolean _bfd_srec_forceS3;
+/* Width of data in bytes for verilog output.
+ This variable is declared in bfd/verilog.c and can be modified by
+ the --verilog-data-width parameter. */
+extern unsigned int VerilogDataWidth;
+
/* Forward declarations. */
static void setup_section (bfd *, asection *, void *);
static void setup_bfd_headers (bfd *, bfd *);
@@ -653,6 +660,7 @@ copy_usage (FILE *stream, int exit_status)
--decompress-debug-sections Decompress DWARF debug sections using zlib\n\
--elf-stt-common=[yes|no] Generate ELF common symbols with STT_COMMON\n\
type\n\
+ --verilog-data-width <number> Specifies data width, in bytes, for verilog output\n\
-M --merge-notes Remove redundant entries in note sections\n\
--no-merge-notes Do not attempt to remove redundant notes (default)\n\
-v --verbose List all object files modified\n\
@@ -5478,6 +5486,12 @@ copy_main (int argc, char *argv[])
}
break;
+ case OPTION_VERILOG_DATA_WIDTH:
+ VerilogDataWidth = parse_vma (optarg, "--verilog-data-width");
+ if (VerilogDataWidth < 1)
+ fatal (_("verilog data width must be at least 1 byte"));
+ break;
+
case 0:
/* We've been given a long option. */
break;