musl/arch/sh
Rich Felker 9439ebd766 fix dynamic loader library mapping for nommu systems
on linux/nommu, non-writable private mappings of files may actually
use memory shared with other processes or the fs cache. the old nommu
loader code (used when mmap with MAP_FIXED fails) simply wrote over
top of the original file mapping, possibly clobbering this shared
memory. no such breakage was observed in practice, but it should have
been possible.

the new code starts by mapping anonymous writable memory on archs that
might support nommu, then maps load segments over top of it, falling
back to read if MAP_FIXED fails. we use an anonymous map rather than a
writable file map to avoid reading more data from disk than needed.
since pages cannot be loaded lazily on fault, in case of large
data/bss, mapping the full file may read a lot of data that will
subsequently be thrown away when processing additional LOAD segments.
as a result, we cannot skip the first LOAD segment when operating in
this mode.

these changes affect only non-FDPIC nommu support.
2015-11-11 17:40:27 -05:00
..
bits fix sh jmp_buf size to match ABI 2015-04-27 20:03:28 -04:00
src work around breakage in sh/fdpic __unmapself function 2015-09-22 04:10:42 +00:00
atomic.h inline llsc atomics when building for sh4a 2015-05-19 00:42:07 -04:00
crt_arch.h generalize sh entry point asm not to assume call dests fit in 12 bits 2015-11-02 18:11:36 -05:00
ksigaction.h fix signal return for sh/fdpic 2015-09-23 18:33:49 +00:00
pthread_arch.h properly access mcontext_t program counter in cancellation handler 2015-11-02 12:41:49 -05:00
reloc.h fix dynamic loader library mapping for nommu systems 2015-11-11 17:40:27 -05:00
syscall_arch.h switch to using trap number 31 for syscalls on sh 2015-06-16 15:25:02 +00:00