This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: RFC: Treat RTLD_GLOBAL as unique to namespace when used with dlmopen
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: "Michael Kerrisk (man-pages)" <mtk dot manpages at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 15 Sep 2015 14:39:40 -0400
- Subject: Re: RFC: Treat RTLD_GLOBAL as unique to namespace when used with dlmopen
- Authentication-results: sourceware.org; auth=none
- References: <55A73673 dot 3060104 at redhat dot com> <55AD4474 dot 3070900 at gmail dot com> <55B285E5 dot 6080708 at redhat dot com>
On 07/24/2015 02:37 PM, Carlos O'Donell wrote:
> With a few more patches I get *almost* all the way there:
[carlos@athas dlmopen_expt]$ ./main
main(): lmid from dlopen(NULL) is 0 (handle = 0x0x7feda4b49168)
main(): dlmopen LM_ID_NEWLM ./libabc.so RTLD_GLOBAL
main(): lmid from dlopen("libabc.so") is 1 (handle = 0x0x1cc7440)
main(): invoking abc_start()
Called abc_start()
abc_start(): lmid from dlopen(NULL) is 1 (handle = 0x0x1cc7440)
abc_start(): dlmopen LM_ID_BASE ./libdef.so RTLD_GLOBAL
abc_start(): dlopen ./libjkl.so RTLD_GLOBAL
abc_start(): dlopen ./libmno.so RTLD_LOCAL
abc_start(): dlopen ./libqrs.so RTLD_LOCAL
abc_start(): invoking qrs_start()
Called qrs_start()
qrs_start(): lmid from dlopen(NULL) is 1 (handle = 0x0x1cc7440)
qrs_start(): lookup of "abc" succeeded
qrs_start(): lookup of "def" failed
qrs_start(): lookup of "jkl" succeeded
qrs_start(): lookup of "mno" failed
qrs_start(): lookup of "main" failed
main(): lookup of "abc" failed
main(): lookup of "def" succeeded
main(): lookup of "jkl" failed
main(): lookup of "mno" failed
[carlos@athas dlmopen_expt]$ echo $?
0
I'm now passing your test.
I wonder if there is anything more complicated we can throw at it?
The design is solidly based on first principles about dynamic
loading, so I don't see anything we can't solve by reworking
the implementation slightly.
I guess the next step is to get all of this into master and start
telling people to use it to solve isolation problems like plugins.
Perhaps write a small blog post about plugin isolation.
Cheers,
Carlos.