musl/arch
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
..
aarch64 properly access mcontext_t program counter in cancellation handler 2015-11-02 12:41:49 -05:00
arm explicitly assemble all arm asm sources as UAL 2015-11-10 00:01:55 -05:00
i386 properly access mcontext_t program counter in cancellation handler 2015-11-02 12:41:49 -05:00
microblaze properly access mcontext_t program counter in cancellation handler 2015-11-02 12:41:49 -05:00
mips properly access mcontext_t program counter in cancellation handler 2015-11-02 12:41:49 -05:00
or1k properly access mcontext_t program counter in cancellation handler 2015-11-02 12:41:49 -05:00
powerpc properly access mcontext_t program counter in cancellation handler 2015-11-02 12:41:49 -05:00
sh fix dynamic loader library mapping for nommu systems 2015-11-11 17:40:27 -05:00
x32 properly access mcontext_t program counter in cancellation handler 2015-11-02 12:41:49 -05:00
x86_64 properly access mcontext_t program counter in cancellation handler 2015-11-02 12:41:49 -05:00