freebsd-dev/libexec/rtld-elf
Konstantin Belousov 69ca61ba5e Only perform .bss mapping and cleaning operations when segment file size
is not equal to its memory size.

This eliminates unneeded clearing of the text segment that often
happens due to text end not being page-aligned.

For instance,
$ readelf -l /lib/libedit.so.6
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x139e1 0x139e1 R E 0x1000
  LOAD           0x014000 0x00014000 0x00014000 0x00f04 0x00f14 RW  0x1000
  DYNAMIC        0x014cc4 0x00014cc4 0x00014cc4 0x000d0 0x000d0 RW  0x4
$ procstat -v $$ (for /bin/sh)
68585 0x28097000 0x280aa000 r-x    6    0  21  14 CN vn /lib/libedit.so.6
68585 0x280aa000 0x280ab000 r-x    1    0   1   0 CN vn /lib/libedit.so.6 <==
68585 0x280ab000 0x280ac000 rwx    1    0   1   0 CN vn /lib/libedit.so.6
Note the splitted map entry marked by '<=='.

Reviewed by:	kan
Approved by:	re (kensmith)
MFC after:	1 month
2009-07-17 19:32:04 +00:00
..
amd64 Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, use 2009-04-19 23:02:50 +00:00
arm Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, use 2009-04-19 23:02:50 +00:00
i386 Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, use 2009-04-19 23:02:50 +00:00
ia64 Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, use 2009-04-19 23:02:50 +00:00
mips Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, use 2009-04-19 23:02:50 +00:00
powerpc Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, use 2009-04-19 23:02:50 +00:00
sparc64 Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, use 2009-04-19 23:02:50 +00:00
debug.c Fix warnings on 64 bit platforms. 2003-06-19 16:09:18 +00:00
debug.h Use C99's varadic macro syntax instead of gcc's. 2006-03-28 18:26:47 +00:00
libmap.c Fix a malloc overrun in 32-bit compat libmap lookup code. 2006-01-31 06:08:28 +00:00
libmap.h Description from Dan: 2005-02-04 02:46:41 +00:00
Makefile Second attempt at eliminating .text relocations in shared libraries 2009-07-14 21:19:13 +00:00
malloc.c In preparation for a new malloc implementation: 2006-01-12 07:28:21 +00:00
map_object.c Only perform .bss mapping and cleaning operations when segment file size 2009-07-17 19:32:04 +00:00
rtld_lock.c Prefer <sys/param.h> to <machine/param.h> for the definition of 2009-04-20 10:35:50 +00:00
rtld_lock.h Provide custom simple allocator for rtld locks in libthr. The allocator 2008-12-02 11:58:31 +00:00
rtld_tls.h Add support for Thread Local Storage. 2004-08-03 08:51:00 +00:00
rtld.1 Document RTLD_NODELETE, -z nodelete and -z origin support. 2009-04-01 14:38:20 +00:00
rtld.c Fix a typo in the same comment, one line below. 2009-06-23 14:12:49 +00:00
rtld.h Allow order of initialization of loaded shared objects to be 2009-06-20 14:16:41 +00:00
Symbol.map Allow the NULL, RTLD_SELF and RTLD_NEXT handles to work with dlfunc(3). 2009-04-03 19:17:23 +00:00
xmalloc.c Add function prototypes. 2003-06-19 05:28:26 +00:00