This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Including contents of arbitrary files in linker output
- From: Richard Henderson <rth at redhat dot com>
- To: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>, binutils at sourceware dot org
- Date: Thu, 22 May 2014 11:43:58 -0700
- Subject: Re: Including contents of arbitrary files in linker output
- Authentication-results: sourceware.org; auth=none
- References: <20140522131737 dot GA2679 at atmel dot com>
On 05/22/2014 06:17 AM, Senthil Kumar Selvaraj wrote:
> The use case is to embed the ELF output for a machine (M1) in the ELF
> output for another machine (M2). One "hacky" way I found is to generate a
> hex/bin out of the ELF for M1, and generate an ELF for M2 using objcopy
> for M2 and the hex/bin file. I then used the linker script to place
> everything from the ELF for M2 into an output section at a specific
> address.
One can also use the assembler directive ".incbin". Which is generally more
useful than objcopy because one can also define what section the data appears
in, and define symbols around it.
r~