lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Philippe Lhoste wrote:
Jay Carlson wrote:

I'm confused. Why don't you just use the linker to put in the data that you want? The most portable way to do this is just stuff everything into a const char[] and compile it. If you want to skip the octets->.c->.o overhead I suppose you could use objcopy to go directly from octets->.o, or use a linker script for more control.

If the goal is to avoid having the whole development environment including headers on the machine performing the append, then ship a partially linked version of the lua executable with a weak symbol that will be supplied by the .o containing the octets. The target machine then just needs objcopy and a linker.

If you can't depend on having a linker on the target machine, yeah, you're going to have to play around with libelf like lhf says. But just about everybody has a linker.

Not on Windows.

Right. I suppose you could package up mingw GNU ld into a point-and-click tool. But the context for this thread was "what can we do for ELF?"