This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: objcopy and ld: problem embedding string resource in executable


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]