freebsd-dev/lib/libc
Alex Richardson b54a59f3ba Reduce size of rtld by 22% by pulling in less code from libc
Currently RTLD is linked against libc_nossp_pic which means that any libc
symbol used in rtld can pull in a lot of depedencies. This was causing
symbol such as __libc_interposing and all the pthread stubs to be included
in RTLD even though they are not required. It turns out most of these
dependencies can easily be avoided by providing overrides inside of rtld.

This change is motivated by CHERI, where we have an experimental ABI that
requires additional relocation processing to allow the use of function
pointers inside of rtld. Instead of adding this self-relocation code to
RTLD I attempted to remove most function pointers from RTLD and discovered
that most of them came from the libc dependencies instead of being actually
used inside rtld.

A nice side-effect of this change is that rtld is now 22% smaller on amd64.

   text	   data	    bss	    dec	    hex	filename
0x21eb6	  0xce0	  0xe60	 145910	  239f6	/home/alr48/ld-elf-x86.before.so.1
0x1a6ed	  0x728	  0xdd8	 113645	  1bbed	/home/alr48/ld-elf-x86.after.so.1

The number of R_X86_64_RELATIVE relocations that need to be processed on
startup has also gone down from 368 to 187 (almost 50% less).

Reviewed By:	kib
Differential Revision: https://reviews.freebsd.org/D20663
2019-06-30 11:49:58 +00:00
..
aarch64 Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
amd64 Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros. 2019-05-16 22:20:54 +00:00
arm Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
capability Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
compat-43 General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
db Remove "All rights reserved" from my files. 2018-05-10 06:41:08 +00:00
gdtoa libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
gen Reduce size of rtld by 22% by pulling in less code from libc 2019-06-30 11:49:58 +00:00
gmon mcount: tidy up ANSIfication 2018-10-20 22:39:35 +00:00
i386 Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
iconv libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
include Add libc stub for pthread_getthreadid_np(3). 2019-06-23 10:50:26 +00:00
inet libc: fix cases of undefined behavior. 2018-08-07 15:24:19 +00:00
isc SPDX: more ISC-related files. 2017-12-08 17:52:53 +00:00
locale Fix WITHOUT_ICONV build after r340276. 2018-11-14 09:06:15 +00:00
md Replace dot-dot relative pathing with SRCTOP-relative paths where possible 2017-01-20 03:23:24 +00:00
mips Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
nameser SPDX: license IDs for some ISC-related files. 2017-12-08 15:57:29 +00:00
net typo: suppported. 2019-05-29 02:08:23 +00:00
nls Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
posix1e Remove some redundant code in _posix1e_acl_strip_np 2019-02-19 19:15:15 +00:00
powerpc powerpc: Transition to Secure-PLT, like most other OSs 2019-06-25 00:40:44 +00:00
powerpc64 revert r346588 for now 2019-05-11 15:17:42 +00:00
powerpcspe Fix fabs(3) for powerpcspe, this time for real 2018-07-26 14:42:20 +00:00
quad ANSIfy libc/quad 2018-10-21 00:20:40 +00:00
regex regcomp: revert part of r341838 which turned out to be unrelated 2018-12-19 23:28:56 +00:00
resolv Rather than using the legacy IP struct fields in the union for the 2019-06-04 20:53:35 +00:00
riscv Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
rpc Fix CONFS to append the value in this case. 2018-09-18 01:38:44 +00:00
secure Carefully update stack guard bytes inside __guard_setup(). 2018-04-24 15:59:39 +00:00
softfloat Add implementations for clog(3), clogf(3), and clog(3). 2018-05-13 09:54:34 +00:00
sparc64 Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
stdio GC a historical artifact. 2019-02-07 23:17:44 +00:00
stdlib Fix -Wsign-compare warnings in realpath.c 2019-06-26 15:43:20 +00:00
stdtime strptime: make %k and %l specifiers match their description in 2018-11-03 23:37:13 +00:00
string libc: update strstr implementation to match musl 2019-04-09 15:52:18 +00:00
sys Typo. 2019-06-28 16:42:44 +00:00
tests Provide separate accounting for user-wired pages. 2019-05-13 16:38:48 +00:00
uuid libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
x86 Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros. 2019-05-16 22:20:54 +00:00
xdr General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
yp libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
libc_nossp.ldscript Add different libc ldscript: the one without libssp -- 2016-10-12 13:19:21 +00:00
libc.ldscript
Makefile revert r341429 "disable BIND_NOW in libc, libthr, and rtld" 2019-03-28 02:12:32 +00:00
Makefile.depend DIRDEPS_BUILD: Regenerate without local dependencies. 2016-02-24 17:20:11 +00:00
Versions.def Create namespace for the symbols added during 13-CURRENT cycle. 2018-11-12 19:12:14 +00:00