|
Message-ID: <20150911064504.GA21467@brightrain.aerifal.cx> Date: Fri, 11 Sep 2015 02:45:04 -0400 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: dynamic linker bootstrap/rcrt changes 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
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.