Bug 13005 - Allow objcopy with -B switch and intelhex (and similar) input format
Summary: Allow objcopy with -B switch and intelhex (and similar) input format
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: unspecified
: P2 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-19 12:22 UTC by Jan Waclawek
Modified: 2011-07-19 15:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
Project(s) to access:
ssh public key:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Waclawek 2011-07-19 12:22:30 UTC
Sometimes it is desired to link in a binary file for example as an array initializer. For this, objcopy can be utilized, with the binary file as an input and for example elf as output format, placing the data into a single, explicitly named section. 

The architecture of output file can be explicitly set using the -B switch. That possibility is constrained explicitly to binary input files, for other input formats, the diagnostics "Warning: input target 'binary' required for binary architecture parameter." is output and the switch is subsequently ignored.

However, the binary file might might come in a "nearly-binary" format, such as intelhex. 

While it is always possible to convert such format into "pure" binary, it would be nice if objcopy would allow to use the -B switch with intelhex and similar input formats directly.
Comment 1 Ian Lance Taylor 2011-07-19 13:19:59 UTC
You didn't mention which version you are using.  This is fixed in the binutils 2.21 release.  Thanks for the bug report.
Comment 2 Jan Waclawek 2011-07-19 15:22:18 UTC
Indeed. I used an older version (basically by mistake as I intended to test multiple versions). Checking with version 2.21 shows it works as advertised :-)

My apologies and thanks.