musl/src/ldso/dynlink.c, branch master musl - an implementation of the standard library for Linux-based systems move dynamic linker to its own top-level directory, ldso 2016年01月26日T00:29:55+00:00 Rich Felker dalias@aerifal.cx 2016年01月26日T00:29:55+00:00 5552ce52000855906a5cb4f08f2e456573cca51f this eliminates the last need for the SHARED macro to control how files in the src tree are compiled. the same code is used for both libc.a and libc.so, with additional code for the dynamic linker (from the new ldso tree) being added to libc.so but not libc.a. separate .o and .lo object files still exist for the src tree, but the only difference is that the .lo files are built as PIC. in the future, if/when we add dlopen support for static-linked programs, much of the code in dynlink.c may be moved back into the src tree, but properly factored into separate source files. in that case, the code in the ldso tree will be reduced to just the dynamic linker entry point, self-relocation, and loading of libraries needed by the main application.
this eliminates the last need for the SHARED macro to control how
files in the src tree are compiled. the same code is used for both
libc.a and libc.so, with additional code for the dynamic linker (from
the new ldso tree) being added to libc.so but not libc.a. separate .o
and .lo object files still exist for the src tree, but the only
difference is that the .lo files are built as PIC.
in the future, if/when we add dlopen support for static-linked
programs, much of the code in dynlink.c may be moved back into the src
tree, but properly factored into separate source files. in that case,
the code in the ldso tree will be reduced to just the dynamic linker
entry point, self-relocation, and loading of libraries needed by the
main application.
move static-linked stub dlsym out of dynlink.c 2016年01月26日T00:04:45+00:00 Rich Felker dalias@aerifal.cx 2016年01月26日T00:01:22+00:00 4058795d4938ea72a27fb3231ce52c69c7e39637 the function name is still __-prefixed because it requires an asm wrapper to pass the caller's address in order for RTLD_NEXT to work. since this was the last function in dynlink.c still used for static linking, now the whole file is conditional on SHARED being defined.
the function name is still __-prefixed because it requires an asm
wrapper to pass the caller's address in order for RTLD_NEXT to work.
since this was the last function in dynlink.c still used for static
linking, now the whole file is conditional on SHARED being defined.
move static-linked stub dlopen out of dynlink.c 2016年01月25日T23:58:06+00:00 Rich Felker dalias@aerifal.cx 2016年01月25日T23:58:06+00:00 14469371cd1efd2be44f0825fec9ad8bb3216da9
move dlinfo out of dynlink.c 2016年01月25日T23:55:35+00:00 Rich Felker dalias@aerifal.cx 2016年01月25日T23:55:35+00:00 b98414732d230c236b9a79c709c2b035ca67be12
move dlclose out of dynlink.c to its own source file 2016年01月25日T23:53:40+00:00 Rich Felker dalias@aerifal.cx 2016年01月25日T23:53:40+00:00 da1fe7f5008e7068f17147ee7c47e4c71a61d057
move static-linked stub invalid dso handle checking out of dynlink.c 2016年01月25日T23:51:33+00:00 Rich Felker dalias@aerifal.cx 2016年01月25日T23:51:33+00:00 891e6547b4fdec10fe4ffa3b1ef5ddb524bcde39
move static/stub version of dladdr out of dynlink.c 2016年01月25日T23:44:29+00:00 Rich Felker dalias@aerifal.cx 2016年01月25日T23:37:05+00:00 4f8f038060739eca4c5cb97bb067529be96658d2
factor dlerror and error-setting code out of dynlink.c 2016年01月25日T23:44:09+00:00 Rich Felker dalias@aerifal.cx 2016年01月25日T22:56:00+00:00 a4fbc82c8e2a311baa0c6b5a4a4cdbb6c8f66edb the ultimate goal of this change is to get all code used in libc.a out of dynlink.c, so that the dynamic linker code can be moved to its own tree and object files in the src tree can all be shared between libc.a and libc.so.
the ultimate goal of this change is to get all code used in libc.a out
of dynlink.c, so that the dynamic linker code can be moved to its own
tree and object files in the src tree can all be shared between libc.a
and libc.so.
add arch/abi info to dynamic linker's id/version output 2016年01月22日T04:04:16+00:00 Rich Felker dalias@aerifal.cx 2016年01月22日T04:04:16+00:00 0f5eb3de2955e2eaf5ee4b9637d9216f82a97fbd
ldso: fix the dtv update logic in __tls_get_new 2015年11月28日T18:34:17+00:00 Szabolcs Nagy nsz@port70.net 2015年11月26日T18:59:46+00:00 12978acb3066db738c8c15121e81adbb63739876 if two or more threads accessed tls in a dso that was loaded after the threads were created, then __tls_get_new could do out-of-bound memory access (leading to segfault). accidentally byte count was used instead of element count when the new dtv pointer was computed. (dso->new_dtv is (void**).) it is rare that the same dso provides dtv for several threads, the crash was not observed in practice, but possible to trigger.
if two or more threads accessed tls in a dso that was loaded after
the threads were created, then __tls_get_new could do out-of-bound
memory access (leading to segfault).
accidentally byte count was used instead of element count when
the new dtv pointer was computed. (dso->new_dtv is (void**).)
it is rare that the same dso provides dtv for several threads,
the crash was not observed in practice, but possible to trigger.

AltStyle によって変換されたページ (->オリジナル) /