remove freeing of dynamic linker data when dlopen/dlsym are not used
authorRich Felker <dalias@aerifal.cx>
Fri, 5 Oct 2012 01:08:53 +0000 (21:08 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 5 Oct 2012 01:08:53 +0000 (21:08 -0400)
commitc91aa03d2488ef2c48276510dec360ed9582e861
treeb54a1a051a3bc1850a2124adfda3dc224c5987c2
parent9b153c043ea486d28f96a7e01419f650fe0e1b26
remove freeing of dynamic linker data when dlopen/dlsym are not used

this was an optimization to save/recover a minimal amount of extra
memory for use by malloc, that's becoming increasingly costly to keep
around. freeing this data:

1. breaks debugging with gdb (it can't find library symbols)
2. breaks thread-local storage in shared libraries

it would be possible to disable freeing when TLS is used, but in
addition to the above breakages, tracking whether dlopen/dlsym is used
adds a cost to every symbol lookup, possibly making program startup
slower for large programs. combined with the complexity, it's not
worth it. we already save/recover plenty of memory in the dynamic
linker with reclaim_gaps.
src/ldso/dynlink.c