This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Specifying symbol names under which binary values are added
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Mitar <mmitar at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Sun, 12 Mar 2017 09:20:46 -0700
- Subject: Re: Specifying symbol names under which binary values are added
- Authentication-results: sourceware.org; auth=none
- References: <CAKLmikP9kL42F9ku57Wv0GVOE3+5zBSfMH+tE_3CMm0G-ca2nA@mail.gmail.com>
> ld --relocatable --format==binary /long/path/to/image.jpg -o image.o
>
> To add the image.jpg to object. The issue is that symbols under which
> the image is added are based on that filename provided. So for
> /long/path/to/image.jpg this is something like
> _long_path_to_image_jpg. Is there a way to specify the base symbol
> name (to which then start, end, and size are appended) myself? The
> issue is that by embedding paths, builds become harder to make
> reproducible.
Take a look at the .incbin assembler directive -- you can embed your
file into an object using the assembler instead of the linker, and
specify your own symbols.
-cary