mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: RTLD_LAZY deferred symbol binding
Date: Wed, 11 Dec 2019 08:19:50 -0500	[thread overview]
Message-ID: <20191211131950.GM1666@brightrain.aerifal.cx> (raw)
In-Reply-To: <4346191576065348@iva8-3634a30a817d.qloud-c.yandex.net>

On Wed, Dec 11, 2019 at 02:55:48PM +0300, Scherbatiy Alexander wrote:
> 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

No, it's really a bug to be relying on this behavior, as it precludes
much-wanted hardening and is not well-defined per the supported
standards. Deferred binding was added for the sake of a very small but
important and stubborn set of software (i.e. Xorg) that was depending
on lazy binding and where musl-based dists were needing messy hacks to
make it work without (explicit load order of modules in xorg.conf).
The software that needs this behavior can be built with -z lazy as
needed. This is not unique to musl; it applies to hardened glibc
toolchains/distros where bindnow is default, too.

> or the documentation needs to be updated?

That's the documentation for ld, which applies if you invoke ld as a
command. That's not how you link hosted software. It's linked by
invoking $(CC) (e.g. gcc) which may be the part passing -z now; I
forget. If the default is actually changed in ld, then yes ld should
be patched to print the default it was configured with accurately (and
I would think such a patch would be acceptable for upstream).

Rich


  reply	other threads:[~2019-12-11 13:19 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 [this message]
     [not found]   ` <4372011576065223@myt5-7210d748eb79.qloud-c.yandex.net>
2019-12-11 13:11     ` Szabolcs Nagy

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=20191211131950.GM1666@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).