mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: Scherbatiy Alexander <alexander.scherbatiy@bell-sw.com>
Cc: musl@lists.openwall.com
Subject: Re: RTLD_LAZY deferred symbol binding
Date: Wed, 11 Dec 2019 14:11:17 +0100	[thread overview]
Message-ID: <20191211131117.GP23985@port70.net> (raw)
In-Reply-To: <4372011576065223@myt5-7210d748eb79.qloud-c.yandex.net>

* Scherbatiy Alexander <alexander.scherbatiy@bell-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@port70.net>:
> > * Scherbatiy Alexander <alexander.scherbatiy@bell-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).


      parent reply	other threads:[~2019-12-11 13:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11 10:09 Scherbatiy Alexander
2019-12-11 10:35 ` Szabolcs Nagy
2019-12-11 11:55   ` Scherbatiy Alexander
2019-12-11 13:19     ` Rich Felker
     [not found]   ` <4372011576065223@myt5-7210d748eb79.qloud-c.yandex.net>
2019-12-11 13:11     ` Szabolcs Nagy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191211131117.GP23985@port70.net \
    --to=nsz@port70.net \
    --cc=alexander.scherbatiy@bell-sw.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).