rtld: Shrink by eliminating stdio
authorJohn Marino <draco@marino.st>
Fri, 16 Mar 2012 19:46:52 +0000 (20:46 +0100)
committerJohn Marino <draco@marino.st>
Fri, 16 Mar 2012 21:34:01 +0000 (22:34 +0100)
commitb2cf26499615896e389f50012c0bf803e99bc7f3
treed27861fd5a11cc1062be4b1d4195bc2af78d8eea
parentc231b5a4409affd5c45dc50be8c8c06a8e8fb519
rtld: Shrink by eliminating stdio

Eliminate stdio for parsing libmap.conf, and instead parse it from direct
mapping.  Also stop using strerror(3) in rtld which sucks in msgcat and
stdio.  Instead directly access sys_errlist array of error messages with
private rtld_strerror() function.

Results on x86_64 (includes debug symbols):

> size /usr/libexec/ld-elf.so.2*
   text    data     bss     dec     hex filename
  95294    1560    7680  104534   19856 /usr/libexec/ld-elf.so.2
 108830    3128   18216  130174   1fc7e /usr/libexec/ld-elf.so.2.old

> ls -al /usr/libexec/ld-elf.so.2*
-r-xr-xr-x  1 root  wheel  305763 Mar 16 20:33 /usr/libexec/ld-elf.so.2
-r-xr-xr-x  1 root  wheel  370392 Mar 14 00:02 /usr/libexec/ld-elf.so.2.old

Taken from:
FreeBSD SVN 232862 (2012-03-12)
FreeBSD SVN 232974 (2012-03-14)
libexec/rtld-elf/libmap.c
libexec/rtld-elf/map_object.c
libexec/rtld-elf/rtld.c
libexec/rtld-elf/rtld.h