This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] dlopen: Fix issues related to NODELETE handling and relocations
* Carlos O'Donell:
>> +/* Globally exported. Set by the main program to true before
>> + termination, and used by tst-dlopen-nodelete-reloc-mod2.so to
>> + trigger marking his module as NODELETE (and also for its destructor
>
> s/his/this/g
Fixed.
>> +static void __attribute__ ((destructor))
>> +fini (void)
>> +{
>> + /* This object is never loaded completely. */
>
> OK, because we never finish up doing the work because mod16 fails.
>
>> + puts ("error: tst-dlopen-nodelete-reloc-mod15.so destructor invoked");
>
> Why doesn't this fail the test?
Thinko on my part. Fixed.
>> diff --git a/elf/tst-dlopen-nodelete-reloc-mod16.c b/elf/tst-dlopen-nodelete-reloc-mod16.c
>> new file mode 100644
>> index 0000000000..f836f04fb5
>> --- /dev/null
>> +++ b/elf/tst-dlopen-nodelete-reloc-mod16.c
>> +int
>> +global_function_mod15 (void)
>
> OK. This interposes global_function_mod15 in mod15.
Ugh. Fixed as well.
>> diff --git a/elf/tst-dlopen-nodelete-reloc-mod5.c b/elf/tst-dlopen-nodelete-reloc-mod5.c
>> new file mode 100644
>> index 0000000000..f876fa0f97
>> +/* Defined in tst-dlopen-nodelete-reloc-mod3.so. The dependency is
>> + expressed via DT_NEEDED on the intermedia DSO
>
> s/intermedia/intermediate/g
Fixed.
>> + Sixth test: NODELETE status is retained after relocation failure
>> + with unique symbol dependency. The object graph ensures that the
>> + unique symbol binding is processed before the dlopen failure.
>> +
>> + DT_NEEDED
>> + mod17 --(DT_NEEDED)--> mod15 --(unique symbol)--> mod14
>> + \ ^ (RTLD_NODELETE)
>> + \ (DT_NEEDED)
>> + \ |
>> + `---(DT_NEEDED)--> mod16
>> + (fails to relocate)
>> +
>> + mod14 must remain NODELETE after opening mod17 failed. */
>
> OK. Correct.
I added:
mod14 is loaded first, and the loading mod17 is attempted.
You indicated off-list that you wouldn't object pushing this now, so
I've done that after retesting.
Thanks,
Florian