This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Can LD link a raw binary directly?
On Thu, Aug 28, 2008 at 9:51 PM, Pan ruochen <panruochen@gmail.com> wrote:
> Hi All,
>
> 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.
may be you can use .incbin directly to include your data into a
section of your choice in assembly file. then with the help of linker
script emit it to right output segment.
-Khem