mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: dynamic linker bootstrap/rcrt changes
Date: Fri, 11 Sep 2015 02:45:04 -0400	[thread overview]
Message-ID: <20150911064504.GA21467@brightrain.aerifal.cx> (raw)

Working on static-PIE and FDPIC has shown the current approach (symbol
name lookup of "__dls2") to getting from stage 1 to stage 2 is not
what we should be doing. It requires -rdynamic for static PIE to work,
which is clunky and potentially bloated for large programs, and for
FDPIC the symbol lookup does not produce a callable function pointer
but rather an actual code address.

What I'd like to do is punt on having _[dl]start_c make the call into
__dls2 and instead have it return, leaving the calling asm again
responsible for chaining into the next stage. This brings back a small
asm burden I'd tried to eliminate, but it reduces code size and
eliminates the above problems.

One way we might could mitigate the asm burden is by having the crt
asm leave an extra N words below the original sp (argv-1) when making
the calls. This would give us space to pass state from stage 1 to
stage 2 (and possibly beyond) without the need for per-arch asm to
shuffle around argument registers and individual stack slots. This
would make it so each stage could take a single argument, orig_sp.

Rich


             reply	other threads:[~2015-09-11  6:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-11  6:45 Rich Felker [this message]
2015-09-16  5:36 ` Rich Felker

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=20150911064504.GA21467@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).