[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [Proposal] Load module symbols from main program
- From: William Ahern <william@...>
- Date: Fri, 22 Apr 2016 15:46:14 -0700
On Fri, Apr 22, 2016 at 10:55:57AM +0200, Karel Tuma wrote:
> Excerpts from Xavier Wang's message of 2016-04-22 08:02:20 +0200:
> > I have made a Lua patch for this proposal.
> > to demonstrate it, just compile a normal lua53.dll, and build lua.c
> > with any other C modules (e.g. lpath.c), and just:
> This will not work unless you link the binary with -Wl,--export-dynamic
> or the equivalent . AFAIK POSIX does not support symbols introduced
> via program binary, only whatever is opened via dlopen() is guaranteed
> to populate runtime symbol table.
>From the POSIX specification for dlopen:
If file is a null pointer, dlopen() shall return a global symbol table
handle for the currently running process image. This symbol table handle
shall provide access to the symbols from an ordered set of executable
object files consisting of the original program image file, any executable
object files loaded at program start-up as specified by that process file
(for example, shared libraries), and the set of executable object files
loaded using dlopen() operations with the RTLD_GLOBAL flag.