Re: [Proposal] Load module symbols from main program
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: [Proposal] Load module symbols from main program
- From: Xavier Wang <weasley.wx@...>
- Date: 2016年4月23日 17:12:56 +0800
2016年04月23日 16:23 GMT+08:00 Karel Tuma <kat@lua.cz>:
> Excerpts from William Ahern's message of 2016年04月23日 00:46:14 +0200:
>> object files consisting of the original program image file, any executable
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> In practice, most implementations return NULL and dlsym(NULL, ...) works
> to the same effect. The main issue is that linkers don't preserve global
> symbols of main executable unless specifically instructed to do so.
>
I don't know other systems. but you can just compile like Makefile in
lua itself. it's a single executable, and exported all dynamic
symbols.
I looked into lua's build system, and it use -Wl,-E in linux, and
directly build in Mac OS X, use the same flags will work.
--
regards,
Xavier Wang.