From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/15005 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: RTLD_LAZY deferred symbol binding Date: Wed, 11 Dec 2019 14:11:17 +0100 Message-ID: <20191211131117.GP23985@port70.net> References: <3521821576058976@vla1-2bebf6b1c06e.qloud-c.yandex.net> <20191211103528.GL23985@port70.net> <4372011576065223@myt5-7210d748eb79.qloud-c.yandex.net> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="159489"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: musl@lists.openwall.com To: Scherbatiy Alexander Original-X-From: musl-return-15021-gllmg-musl=m.gmane.org@lists.openwall.com Wed Dec 11 14:11:38 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1if1m8-000fGa-SJ for gllmg-musl@m.gmane.org; Wed, 11 Dec 2019 14:11:32 +0100 Original-Received: (qmail 8058 invoked by uid 550); 11 Dec 2019 13:11:30 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 8035 invoked from network); 11 Dec 2019 13:11:29 -0000 Mail-Followup-To: Scherbatiy Alexander , musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <4372011576065223@myt5-7210d748eb79.qloud-c.yandex.net> Xref: news.gmane.org gmane.linux.lib.musl.general:15005 Archived-At: * Scherbatiy Alexander [2019-12-11 14:53= :43 +0300]: > Thank you. It works. >=20 > I looked at the ld help on linux Alpine and it shows > > ld --help > > -z lazy Mark object lazy runtime binding (default) >=20 > Should the lazy option be used by default or the documentation needs to b= e updated? that's standard binutils documentation and it's correct: i think alpine patches gcc to pass -z now, not ld (and i think gentoo hardened does the same). i guess alpine could maintain a toolchain documentation where it describes the changes compared to upstream defaults, but you can check their patches https://git.alpinelinux.org/aports/tree/main/gcc >=20 > Thanks, > Alexander. >=20 >=20 > 11.12.2019, 13:35, "Szabolcs Nagy" : > > * Scherbatiy Alexander [2019-12-11 1= 3:09:36 +0300]: > >> =C2=A0# build sources > >> =C2=A0gcc -c -fPIC src/resolved_impl.c -Iinclude -o bin/shared/resolve= d_impl.o > >> =C2=A0gcc -c -fPIC src/shared_lib.c -Iinclude -o bin/shared/shared_lib= =2Eo > >> =C2=A0gcc -shared bin/shared/shared_lib.o bin/shared/resolved_impl.o -= Iinclude -o bin/shared/libshared_lib.so > > > > ^^^^^^^^^^^^^^^ > > > > you need to pass -Wl,-z,lazy (and verify it with readelf -d ) > > because alpine (and various other distros) defaults to -z now > > (and then libc obviously cant do lazy binding no matter what > > you specified in dlopen).