3 ms·
Couldn't you tell the linker to use one of the functions in the .o as entry point?
by ygra 13y ago
Couldn't you tell the linker to use one of the functions in the .o as entry point?
- Touche 13y agoCode example? edit: If so I've been doing it wrong for years.
- stephan10h 13y agoThis guy is doing it: http://williamaadams.wordpress.com/2013/03/13/is-that-cool-or-what-embedding-luajit-bytecode/ http://williamaadams.wordpress.com/2013/03/13/is-that-cool-o...
- ygra 13y agold has a -e argument [−4] (and MSVC's link has /ENTRY [37]). Otherwise, if there is a function with the expected name, calling convention and arguments in the object file I doubt the linker will complain. [−4] ftp://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_24.html [37] http://msdn.microsoft.com/library/f9t8842e.aspx http://msdn.microsoft.com/library/f9t8842e.aspx
- oscargrouch 13y agoyes.. 1 - create the object files (with luajit?) 2 - create a main() in c.. use "extern" to reference the external symbol in the .o files and call it from main. The symbols in the object files produced by luajit or whatever need to be exported/ visible.. (are they mangled?) 3 - create a object file for main.c 4 - link the .o created from luajit(or whatever, dart?) and main.o together If the linker cant find the external symbol it wont link to a binary (so you need to know how, in what names they are exported.. use objdump to lookup for symbols)