This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] BZ #17702: Fix recursive dlopen.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 21 Jan 2015 09:12:41 -0500
- Subject: Re: [PATCH] BZ #17702: Fix recursive dlopen.
- Authentication-results: sourceware.org; auth=none
- References: <548A502B dot 1040500 at redhat dot com> <87k31xunra dot fsf at igel dot home> <548B6A46 dot 7020005 at redhat dot com> <877fxwv700 dot fsf at igel dot home> <548B976F dot 2050506 at redhat dot com>
On 12/12/2014 08:33 PM, Carlos O'Donell wrote:
> On 12/12/2014 05:27 PM, Andreas Schwab wrote:
>> "Carlos O'Donell" <carlos@redhat.com> writes:
>>
>>> On 12/12/2014 06:10 AM, Andreas Schwab wrote:
>>>> "Carlos O'Donell" <carlos@redhat.com> writes:
>>>>
>>>>> +LDLIBS-tst-rec-dlopen = -ldl
>>>>> +$(objpfx)tst-rec-dlopen: $(libdl)
>>>>
>>>> Why do you need to set LDLIBS?
>>>
>>> How else do I get it to to link libdl.so against the test case?
>>
>> It's listed as a dependency.
>
> I see. It does indeed work with just the dependency.
> I guess I don't know what LDLIBS is for? Is it only
> for building DSOs?
>
> Here is a v2 with several fixes, including checking to make sure
> that the return value of the called function is indeed that of
> moddummy1 and provides some assurance that nothing failed.
>
> Cheers,
> Carlos.
>
> v2.
> - Remove LDLIBS
> - tst-rec-dlopen should depend on moddummy1 and moddummy2 DSOs.
> - Use return of DSO to determine if DSO func was called and that
> dummy1 was the outermost called function.
I have committed v2 to allow dlopen to be called recursively.
We're using this in RHEL to allow 3rd party malloc interposes
to use dlopen.
Cheers,
Carlos.