From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/15003 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Scherbatiy Alexander Newsgroups: gmane.linux.lib.musl.general Subject: Re: RTLD_LAZY deferred symbol binding Date: Wed, 11 Dec 2019 14:55:48 +0300 Message-ID: <4346191576065348@iva8-3634a30a817d.qloud-c.yandex.net> References: <3521821576058976@vla1-2bebf6b1c06e.qloud-c.yandex.net> <20191211103528.GL23985@port70.net> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="108344"; mail-complaints-to="usenet@blaine.gmane.org" To: Szabolcs Nagy , "musl@lists.openwall.com" Original-X-From: musl-return-15019-gllmg-musl=m.gmane.org@lists.openwall.com Wed Dec 11 12:56:04 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 1if0b5-000S6H-Kr for gllmg-musl@m.gmane.org; Wed, 11 Dec 2019 12:56:03 +0100 Original-Received: (qmail 15893 invoked by uid 550); 11 Dec 2019 11:56:00 -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 15867 invoked from network); 11 Dec 2019 11:56:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bell-sw.com; s=mail; t=1576065348; bh=8aB+x0OG5ytXyJqF46Y4BGxnGaPnyoaF6hApeYMxHko=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=sv5TGHPWETzixGwa0RrkkzBqzWGxKxevyFjTMNlluHrTe6ktnFw3PqLazLj33W2y7 GpZAxYV7DU5KENDNeT7E+FDkHRPH3k25UN/ONl0R+oV9MpxKdpJeM/FJBPsEQIQW92 Oom6ATRfABy6h9iA60rHIgo5HaZXjVzzvVKdJWME= Authentication-Results: mxback23j.mail.yandex.net; dkim=pass header.i=@bell-sw.com In-Reply-To: <20191211103528.GL23985@port70.net> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Xref: news.gmane.org gmane.linux.lib.musl.general:15003 Archived-At: Thank you. It works. I looked at the ld help on linux Alpine and it shows > ld --help > -z lazy Mark object lazy runtime binding (default) Should the lazy option be used by default or the documentation needs to be updated? Thanks, Alexander. 11.12.2019, 13:35, "Szabolcs Nagy" : > * Scherbatiy Alexander [2019-12-11 13:09:36 +0300]: >>  # build sources >>  gcc -c -fPIC src/resolved_impl.c -Iinclude -o bin/shared/resolved_impl.o >>  gcc -c -fPIC src/shared_lib.c -Iinclude -o bin/shared/shared_lib.o >>  gcc -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).