musl/src
Rich Felker 2907afb8db introduce new symbol-lookup-free rcrt1/dlstart stage chaining
previously, the call into stage 2 was made by looking up the symbol
name "__dls2" (which was chosen short to be easy to look up) from the
dynamic symbol table. this was no problem for the dynamic linker,
since it always exports all its symbols. in the case of the static pie
entry point, however, the dynamic symbol table does not contain the
necessary symbol unless -rdynamic/-E was used when linking. this
linking requirement is a major obstacle both to practical use of
static-pie as a nommu binary format (since it greatly enlarges the
file) and to upstream toolchain support for static-pie (adding -E to
default linking specs is not reasonable).

this patch replaces the runtime symbolic lookup with a link-time
lookup via an inline asm fragment, which reloc.h is responsible for
providing. in this initial commit, the asm is provided only for i386,
and the old lookup code is left in place as a fallback for archs that
have not yet transitioned.

modifying crt_arch.h to pass the stage-2 function pointer as an
argument was considered as an alternative, but such an approach would
not be compatible with fdpic, where it's impossible to compute
function pointers without already having performed relocations. it was
also deemed desirable to keep crt_arch.h as simple/minimal as
possible.

in principle, archs with pc-relative or got-relative addressing of
static variables could instead load the stage-2 function pointer from
a static volatile object. that does not work for fdpic, and is not
safe against reordering on mips-like archs that use got slots even for
static functions, but it's a valid on i386 and many others, and could
provide a reasonable default implementation in the future.
2015-09-17 06:30:55 +00:00
..
aio make all objects used with atomic operations volatile 2015-03-03 22:50:02 -05:00
complex complex: fix ctanh(+-0+i*nan) and ctanh(+-0+-i*inf) 2015-05-01 13:37:42 -04:00
conf add legacy functions from sysinfo.h duplicating sysconf functionality 2015-03-04 22:10:01 -05:00
crypt
ctype byte-based C locale, phase 1: multibyte character handling functions 2015-06-16 05:28:48 +00:00
dirent make all objects used with atomic operations volatile 2015-03-03 22:50:02 -05:00
env provide __stack_chk_fail_local in libc.a 2015-06-20 03:01:07 +00:00
errno remove remnants of support for running in no-thread-pointer mode 2015-04-13 19:24:51 -04:00
exit fix atexit when it is called from an atexit handler 2015-07-24 21:22:43 +00:00
fcntl remove dead case for F_SETLKW in fcntl 2015-04-21 13:34:58 -04:00
fenv fix mips fesetenv(FE_DFL_ENV) again 2015-04-17 22:19:58 -04:00
internal provide arch-generic fdpic self-relocation code for crt1 to use 2015-09-12 03:10:44 +00:00
ipc
ldso introduce new symbol-lookup-free rcrt1/dlstart stage chaining 2015-09-17 06:30:55 +00:00
legacy fix futimes legacy function with null tv pointer 2015-05-06 18:53:22 -04:00
linux fix incorrect void return type for syncfs function 2015-07-09 17:07:35 +00:00
locale fix breakage in nl_langinfo from previous commit 2015-09-09 06:04:42 +00:00
malloc mitigate blow-up of heap size under malloc/free contention 2015-08-07 19:19:49 +00:00
math fix regression in x86_64 math asm with old binutils 2015-04-23 06:21:49 -04:00
misc getsubopt: don't include leading = in value string 2015-08-21 01:29:10 -04:00
mman redesign and simplify vmlock system 2015-04-10 02:27:52 -04:00
mq
multibyte fix undefined left-shift of negative values in utf-8 state table 2015-07-25 03:15:45 +00:00
network fix uninitialized scopeid in lookups from hosts file and ip literals 2015-09-11 06:15:06 +00:00
passwd fix spurious errors from pwd/grp functions when nscd backend is absent 2015-06-09 20:15:49 +00:00
prng make all objects used with atomic operations volatile 2015-03-03 22:50:02 -05:00
process switch to using trap number 31 for syscalls on sh 2015-06-16 15:25:02 +00:00
regex byte-based C locale, phase 1: multibyte character handling functions 2015-06-16 05:28:48 +00:00
sched
search
select
setjmp fix build regression in sh-nofpu subarch due to missing symbol 2015-04-24 11:45:25 -04:00
signal remove unused (and invalid) C version of sigsetjmp 2015-09-09 06:59:45 +00:00
stat
stdio fix fclose of permanent (stdin/out/err) streams 2015-09-09 04:31:07 +00:00
stdlib
string reimplement strverscmp to fix corner cases 2015-06-23 00:29:57 +00:00
temp
termios
thread make sh clone asm fdpic-compatible 2015-09-12 02:55:28 +00:00
time match historical behavior for tm_gmtoff member of struct tm 2015-08-14 00:47:46 +00:00
unistd switch to using trap number 31 for syscalls on sh 2015-06-16 15:25:02 +00:00