mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-27 05:00:15 +00:00
2827ab990a
The __libc_freeres framework does not extend to non-libc.so objects. This causes problems in general for valgrind and mtrace detecting unfreed objects in both libdl.so and libpthread.so. This change is a pre-requisite to properly moving the malloc hooks out of malloc since such a move now requires precise accounting of all allocated data before destructors are run. This commit adds a proper hook in libc.so.6 for both libdl.so and for libpthread.so, this ensures that shm-directory.c which uses freeit () to free memory is called properly. We also remove the nptl_freeres hook and fall back to using weak-ref-and-check idiom for a loaded libpthread.so, thus making this process similar for all DSOs. Lastly we follow best practice and use explicit free calls for both libdl.so and libpthread.so instead of the generic hook process which has undefined order. Tested on x86_64 with no regressions. Signed-off-by: DJ Delorie <dj@redhat.com> Signed-off-by: Carlos O'Donell <carlos@redhat.com>
19 lines
245 B
Plaintext
19 lines
245 B
Plaintext
libdl {
|
|
GLIBC_2.0 {
|
|
dladdr; dlclose; dlerror; dlopen; dlsym;
|
|
}
|
|
GLIBC_2.1 {
|
|
dlopen; dlvsym;
|
|
}
|
|
GLIBC_2.3.3 {
|
|
dladdr1; dlinfo;
|
|
}
|
|
GLIBC_2.3.4 {
|
|
dlmopen;
|
|
}
|
|
GLIBC_PRIVATE {
|
|
_dlfcn_hook;
|
|
__libdl_freeres;
|
|
}
|
|
}
|