mailing list of musl libc
 help / color / mirror / code / Atom feed
* dynamic linker bootstrap/rcrt changes
@ 2015-09-11  6:45 Rich Felker
  2015-09-16  5:36 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Rich Felker @ 2015-09-11  6:45 UTC (permalink / raw)
  To: musl

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-16  5:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-11  6:45 dynamic linker bootstrap/rcrt changes Rich Felker
2015-09-16  5:36 ` Rich Felker

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).