Some frameworks (Qt, Windows, Gtk…) offer functionality to add resources to your binaries. I wonder if it would be possible to achieve this without the framework, since all that is really needed is
- a symbol to contain the resource’s address within the binary (data segment)
- a symbol to represent the length of the resource
- the resource itself
How can this be achieved with the gcc toolchain?
You could do this:
This produces an object file that you can link into your executable.
This file will contain these symbols that you’ll have to declare in your C code to
be able to use them