lua-users home
lua-l archive

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


It was thus said that the Great Soni They/Them L. once stated:
> On 2018-02-26 07:04 PM, Sean Conner wrote:
> 
> >   Now, Lua 5.3 *DOES* contain package.loadlib(), which is a wrapper
> >around dlopen()/dlsym().  So keeping in mind the limitations (there must
> >be a unique symbol identifying the entry point of a C module), if you can
> >come up with a way to rename a C-based Lua module and still find that
> >unique symbol *WITHOUT RECOMPILING THE MODULE*, then by all means, go
> >ahead.  I'd love to see the solution.
> 
> Since I can access the symbol table (by reading the module with io.open 
> and looking at all of its symbols), I can probably write something that 
> finds the common prefix for all luaopen_* and omits it when doing 
> requires. This should solve the problem?

  I suppose.  You'll need the ELF specification for Linux and the Mach-O
specification for Mac OS-X.  But in theory that should be possible.

  -spc