This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: objcopy and ld: problem embedding string resource in executable
- From: Cary Coutant <ccoutant at google dot com>
- To: noloader at gmail dot com
- Cc: "shankarke at gmail dot com" <shankarke at gmail dot com>, binutils at sourceware dot org
- Date: Thu, 6 Dec 2012 14:56:57 -0800
- Subject: Re: objcopy and ld: problem embedding string resource in executable
- References: <CAH8yC8=0-sBRwDK2W1zafedGw9HkfNZaRM0+MOgpg0n+t8iFjg@mail.gmail.com> <1353303823893-213514.post@n7.nabble.com> <CAH8yC8me6v6NoeOw1GZkVw0VGb13kFXRONK-LKL60V+XxOpgxg@mail.gmail.com>
> For me, it helps keep resources with the executable. In my case, it
> was some help text written in a text editor rather than placed in
> source files with lots of calls to printf/cout. If I did it the
> classic *nix way, I believe I would have put the help text in
> /usr/share and loaded it if needed. This has caused problems in the
> past in some cases (for example,
> https://groups.google.com/group/cryptopp-users/msg/7edd5084ac06417e).
> For what its worth, this program is cross platform (it has a Makefile
> and Visual Studio solution), so embedding the resource was done on
> both sides.
Have you considered using the assembler's .incbin directive? This is a
convenient way to embed a file verbatim into an object file, and you
don't need to figure out what the output format is. You can also
define start and end symbols to make it easier to find the data in the
running program.
-cary