This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Can LD link a raw binary directly?
- From: Ian Lance Taylor <iant at google dot com>
- To: "Pan ruochen" <panruochen at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 02 Sep 2008 07:07:44 -0700
- Subject: Re: Can LD link a raw binary directly?
- References: <af0faace0808282151j38e3bc45n1a004bac9330147b@mail.gmail.com>
"Pan ruochen" <panruochen@gmail.com> writes:
> I want to put the data of a test file into the output ELF so that
> I can use the test data directly without FS operations.
> The tranditional way is to convert the binary test file to C array
> intializers text,
> and then compile the source including the array, and link objects.
> But this solution seems awkward. The flowchat of this solution is like:
> binary without format --> text --> binary in ELF format
> So I wonder if LD can directly link binaries without format, as it does to
> binaries in ELF format.
Use -b binary.
Ian