This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [pushed] Remove all loaded objects if dlopen fails, ignoring NODELETE [BZ #20839]
- From: Szabolcs Nagy <Szabolcs dot Nagy at arm dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: nd <nd at arm dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, "carlos at redhat dot com" <carlos at redhat dot com>, "gnugerrit at kalvdans dot no-ip dot org" <gnugerrit at kalvdans dot no-ip dot org>
- Date: Mon, 2 Dec 2019 13:52:34 +0000
- Subject: Re: [pushed] Remove all loaded objects if dlopen fails, ignoring NODELETE [BZ #20839]
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K1vpgkY7a7YONwiwSBgTdF7XwX0pa8gvqWVERHfiThc=; b=h/zTVDhY7pwtb6nc4V8zBOZxOWn1BzTNNGY4/NEMZyrxuoSOiBm27yULGkTZhuW0e/JoWXOx9LlGDJK8ZPC/Nrj1TSsyzxP3hFw+589xCMtJKsD3E470k9lSZs5UtmDIlQyTaumIh4n9HQRE4quscoFKGhOYqpeBzWW10+EcNXC3Zwk2hfm4HZe0pccoZj7yKhvaD3STaTjWs+Y+Ojwvcc/SFS3Md5wgHF0agtK+ESwU2JcTkDSa3T33s9BJON+KWCaf5+mmZw+46SAUJFDrcAI93lbO9RHz7vrFhI0xqMUrmZyPvmG26RlwTfzyiU7W2sdiguMo1XnYEU44UvCzjw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mHUWGZfR6TTRAj79rDxnA+jCTyfIfc9wIdNMUNnya5WgNItiiMlEqLyv3m66BU6zcGTXM2tMfZ8nwhuar7P4JLyBh9ukbyAi+95X0x5k6zuW1g7UcDio+oAoiWwZfSfEJjHY88livNvbWPNGkDlJbCH3kmupr4JoOBfSOSsW9wGpl/KY2LCK4P5pUOSbE+fro/2bCO8RF+yMbHgssTdNrb6aMQ56uAAmKtY0ew4ceaW2ZNzsfN2y2pxjmiNTbihP7N+fpLxI135CqH6DqGs0Lp9yk75obvOBRi7y3BIEzEqXngxvvWVHmCxdbrt54X4NZMCedD5noqOQlVxlVoiOPw==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs dot Nagy at arm dot com;
- References: <gerrit.1572549639000.Ib2a3d86af6f92d75baca65431d74783ee0dbc292@gnutoolchain-gerrit.osci.io> <20191127203045.0D46E20AF6@gnutoolchain-gerrit.osci.io> <d7204959-36b4-ef4b-db4e-9c4c9b86b035@arm.com> <87h82izzun.fsf@oldenburg2.str.redhat.com>
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
>