[PATCH] BZ #17702: Fix recursive dlopen.

Carlos O'Donell carlos@redhat.com
Wed Jan 21 14:12:00 GMT 2015


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.



More information about the Libc-alpha mailing list