[pushed] Remove all loaded objects if dlopen fails, ignoring NODELETE [BZ #20839]
Szabolcs Nagy
Szabolcs.Nagy@arm.com
Mon Dec 2 13:52:00 GMT 2019
On 02/12/2019 12:17, Florian Weimer wrote:
> * Szabolcs Nagy:
>> i see
>>
>> FAIL: elf/tst-dlopenfail
>>
>> and
>>
>> $ cat elf/tst-dlopenfail.out
>> info: attempting to load tst-dlopenfailmod1.so
>> tst-dlopenfailmod1 constructor executed
>>
>> on the aarch64 buildbot
>
> It's likely that your toolchain defaults to --no-as-needed. Does this
> patch fix things for you?
yes, this patch fixes the issue.
> diff --git a/elf/Makefile b/elf/Makefile
> index f825354d3f..0debea7759 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -1618,8 +1618,11 @@ LDFLAGS-tst-finilazyfailmod.so = \
> $(objpfx)tst-dlopenfail: $(libdl)
> $(objpfx)tst-dlopenfail.out: \
> $(objpfx)tst-dlopenfailmod1.so $(objpfx)tst-dlopenfailmod2.so
> -# Order matters here. tst-dlopenfaillinkmod.so's soname ensures
> -# a run-time loader failure.
> +# Order matters here. tst-dlopenfaillinkmod.so's soname ensures a
> +# run-time loader failure. --as-needed breaks this test because
> +# nothing actually references tst-dlopenfailmod2.so (with its soname
> +# tst-dlopenfail-missingmod.so).
> +LDFLAGS-tst-dlopenfailmod1.so = -Wl,--no-as-needed
> $(objpfx)tst-dlopenfailmod1.so: \
> $(shared-thread-library) $(objpfx)tst-dlopenfaillinkmod.so
> LDFLAGS-tst-dlopenfaillinkmod.so = -Wl,-soname,tst-dlopenfail-missingmod.so
>
> Thanks,
> Florian
>
More information about the Libc-alpha
mailing list