[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Dynamic module loading problem
- From: Francesco Santini <rincewind@...>
- Date: Thu, 19 Sep 2013 17:10:49 +0200
Hello all,
I'm having a problem with binary module loading under linux x64. I have
to disclose that I am using LuaJIT, but I think the problem I'm having
is more general.
My setup is the following: a program (that is provided to me as-is) is
dynamically loading a .so library (written by me) that contains the Lua
VM (linked dynamically, but I also tried statically). My .so file wants
to load a binary module (which, when loaded from command-line, works fine).
At this point, the "require" fails with the error "unresolved symbol:
lua_gettop". Other modules give other lua-related unresolved symbols.
I have to point out that with a previous version of the main program
this procedure used to work fine.
I read that I should enable the option -Wl,-E at linking, which I did
for my .so file, and in fact my .so file does export all the correct lua
symbols (as confirmed by nm), but that doesn't help. Is the main program
supposed to by compiled with -Wl,-E? Provided that I have no control
over how that program is linked, is there a workaround?
I guess linking lua with the module would help, but I would like to
avoid that if possible.
Thanks in advance!
Francesco