Date: Wed, 11 Dec 2019 14:11:17 +0100 From: Szabolcs Nagy <nsz@...t70.net> To: Scherbatiy Alexander <alexander.scherbatiy@...l-sw.com> Cc: musl@...ts.openwall.com Subject: Re: RTLD_LAZY deferred symbol binding * Scherbatiy Alexander <alexander.scherbatiy@...l-sw.com> [2019-12-11 14:53:43 +0300]: > 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? 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 > > Thanks, > Alexander. > > > 11.12.2019, 13:35, "Szabolcs Nagy" <nsz@...t70.net>: > > * Scherbatiy Alexander <alexander.scherbatiy@...l-sw.com> [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).
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.