musl - an implementation of the standard library for Linux-based systems
Go to file
Rich Felker 9bbddf730f reprocess all libc/ldso symbolic relocations in dynamic linking stage 3
commit f3ddd17380 introduced early
relocations and subsequent reprocessing as part of the dynamic linker
bootstrap overhaul, to allow use of arbitrary libc functions before
the main application and libraries are loaded, but only reprocessed
GOT/PLT relocation types.

commit c093e2e820 added reprocessing of
non-GOT/PLT relocations to fix an actual regression that was observed
on powerpc, but only for RELA format tables with out-of-line addends.
REL table (inline addends at the relocation address) reprocessing is
trickier because the first relocation pass clobbers the addends.

this patch extends symbolic relocation reprocessing for libc/ldso to
support all relocation types, whether REL or RELA format tables are
used. it is believed not to alter behavior on any existing archs for
the current dynamic linker and libc code. the motivations for this
change are consistency and future-proofing. it ensures that behavior
does not differ depending on whether REL or RELA tables are used,
which could lead to undetected arch-specific bugs. it also ensures
that, if in the future code depending on additional relocation types
is added to libc.so, either at the source level or as part of the
compiler runtime that gets pulled in (for example, soft-float with TLS
for fenv), the new code will work properly.

the implementation concept is simple: stage 2 of the dynamic linker
counts the number of symbolic relocations in the libc/ldso REL table
and allocates a VLA to save their addends into; stage 3 then uses the
saved addends in place of the inline ones which were clobbered. for
stack safety, a hard limit (currently 4k) is imposed on the number of
such addends; this should be a couple orders of magnitude larger than
the actual need. this number is not a runtime variable that could
break fail-safety; it is constant for a given libc.so build.
2015-05-25 23:33:59 -04:00
arch fix stack alignment code in mips crt_arch.h 2015-05-24 23:03:47 -04:00
crt mark mips crt code as code 2015-05-25 16:02:49 -04:00
dist add another example option to dist/config.mak 2012-04-24 16:49:11 -04:00
include fix netinet/ether.h for c++ 2015-05-08 08:35:16 -04:00
lib new solution for empty lib dir (old one had some problems) 2011-02-17 17:12:52 -05:00
src reprocess all libc/ldso symbolic relocations in dynamic linking stage 3 2015-05-25 23:33:59 -04:00
tools fix system breakage window during make install due to permissions 2014-01-15 22:29:13 -05:00
.gitignore add version.h to .gitignore; it is a generated file 2014-01-21 01:06:42 -05:00
configure fix syntax errors in configure script 2015-04-22 22:11:48 -04:00
COPYRIGHT update authors/contributors list 2015-03-16 18:43:54 -04:00
INSTALL update notice on broken gcc versions in INSTALL file 2014-07-31 19:02:54 -04:00
Makefile add dependency of dlstart.lo on crt_arch.h to Makefile 2015-04-23 16:49:55 -04:00
README update version reference in the README file 2014-06-25 14:16:53 -04:00
VERSION release 1.1.9 2015-05-12 19:19:08 -04:00
WHATSNEW release 1.1.9 2015-05-12 19:19:08 -04:00

    musl libc

musl, pronounced like the word "mussel", is an MIT-licensed
implementation of the standard C library targetting the Linux syscall
API, suitable for use in a wide range of deployment environments. musl
offers efficient static and dynamic linking support, lightweight code
and low runtime overhead, strong fail-safe guarantees under correct
usage, and correctness in the sense of standards conformance and
safety. musl is built on the principle that these goals are best
achieved through simple code that is easy to understand and maintain.

The 1.1 release series for musl features coverage for all interfaces
defined in ISO C99 and POSIX 2008 base, along with a number of
non-standardized interfaces for compatibility with Linux, BSD, and
glibc functionality.

For basic installation instructions, see the included INSTALL file.
Information on full musl-targeted compiler toolchains, system
bootstrapping, and Linux distributions built on musl can be found on
the project website:

    http://www.musl-libc.org/