musl/src/internal/dynlink.h, branch master musl - an implementation of the standard library for Linux-based systems ldso: convert TLSDESC_BACKWARDS from "#ifdef" to "if" logic 2023年11月07日T02:48:02+00:00 Rich Felker dalias@aerifal.cx 2023年11月07日T02:48:02+00:00 039d3c34f2e3578a8b7ada42f89213b844aa7a4e this style is preferred because it allows the code to be compile-checked even on archs where it is not used.
this style is preferred because it allows the code to be
compile-checked even on archs where it is not used.
fix debugger tracking of shared libraries on mips with PIE main program 2023年01月18日T15:32:14+00:00 Rich Felker dalias@aerifal.cx 2023年01月18日T15:32:14+00:00 f897461d4fe72bb71854a6d0662de83008caccb7 mips has its own mechanisms for DT_DEBUG because it makes _DYNAMIC read-only, and the original mechanism, DT_MIPS_RLD_MAP, was PIE-incompatible. DT_MIPS_RLD_MAP_REL was added to remedy this, but we never implemented support for it. add it now using the same idioms for mips-specific ldso logic.
mips has its own mechanisms for DT_DEBUG because it makes _DYNAMIC
read-only, and the original mechanism, DT_MIPS_RLD_MAP, was
PIE-incompatible. DT_MIPS_RLD_MAP_REL was added to remedy this, but we
never implemented support for it. add it now using the same idioms for
mips-specific ldso logic.
ldso: support DT_RELR relative relocation format 2022年08月02日T21:27:45+00:00 Fangrui Song i@maskray.me 2022年08月02日T21:24:47+00:00 d32dadd60efb9d3b255351a3b532f8e4c3dd0db1 this resolves DT_RELR relocations in non-ldso, dynamic-linked objects.
this resolves DT_RELR relocations in non-ldso, dynamic-linked objects.
have ldso track replacement of aligned_alloc 2020年06月11日T02:02:45+00:00 Rich Felker dalias@aerifal.cx 2020年06月11日T02:02:45+00:00 e9f4fd1185badfc005fcfe5c7de27d58baec057c this is in preparation for improving behavior of malloc interposition.
this is in preparation for improving behavior of malloc interposition.
reintroduce calloc elison of memset for direct-mmapped allocations 2020年06月11日T00:51:17+00:00 Rich Felker dalias@aerifal.cx 2020年06月11日T00:44:51+00:00 25cef5c591fbee755a53f0d7920f4f554f343a53 a new weak predicate function replacable by the malloc implementation, __malloc_allzerop, is introduced. by default it's always false; the default version will be used when static linking if the bump allocator was used (in which case performance doesn't matter) or if malloc was replaced by the application. only if the real internal malloc is linked (always the case with dynamic linking) does the real version get used. if malloc was replaced dynamically, as indicated by __malloc_replaced, the predicate function is ignored and conditional-memset is always performed.
a new weak predicate function replacable by the malloc implementation,
__malloc_allzerop, is introduced. by default it's always false; the
default version will be used when static linking if the bump allocator
was used (in which case performance doesn't matter) or if malloc was
replaced by the application. only if the real internal malloc is
linked (always the case with dynamic linking) does the real version
get used.
if malloc was replaced dynamically, as indicated by __malloc_replaced,
the predicate function is ignored and conditional-memset is always
performed.
move declaration of interfaces between malloc and ldso to dynlink.h 2020年06月03日T01:38:25+00:00 Rich Felker dalias@aerifal.cx 2020年06月03日T01:38:25+00:00 cee88b76f72c826cc3d3360b853a3cf2ec472fd2 this eliminates consumers of malloc_impl.h outside of the malloc implementation.
this eliminates consumers of malloc_impl.h outside of the malloc
implementation.
move stage3_func typedef out of shared internal dynlink.h header 2020年01月01日T02:51:07+00:00 Rich Felker dalias@aerifal.cx 2020年01月01日T02:51:07+00:00 b529ec9b52ff4b94e455f0e6cb1f3ef3994560d5 this interface contract is entirely internal to dynlink.c.
this interface contract is entirely internal to dynlink.c.
add support for powerpc/powerpc64 unaligned relocations 2019年08月11日T21:43:57+00:00 Samuel Holland samuel@sholland.org 2019年06月30日T12:39:20+00:00 08869deb7efbda6e979886cb67e3d5843f92c2e8 R_PPC_UADDR32 (R_PPC64_UADDR64) has the same meaning as R_PPC_ADDR32 (R_PPC64_ADDR64), except that its address need not be aligned. For powerpc64, BFD ld(1) will automatically convert between ADDR<->UADDR relocations when the address is/isn't at its native alignment. This will happen if, for example, there is a pointer in a packed struct. gold and lld do not currently generate R_PPC64_UADDR64, but pass through misaligned R_PPC64_ADDR64 relocations from object files, possibly relaxing them to misaligned R_PPC64_RELATIVE. In both cases (relaxed or not) this violates the PSABI, which defines the relevant field type as "a 64-bit field occupying 8 bytes, the alignment of which is 8 bytes unless otherwise specified." All three linkers violate the PSABI on 32-bit powerpc, where the only difference is that the field is 32 bits wide, aligned to 4 bytes. Currently musl fails to load executables linked by BFD ld containing R_PPC64_UADDR64, with the error "unsupported relocation type 43". This change provides compatibility with BFD ld on powerpc64, and any static linker on either architecture that starts following the PSABI more closely.
R_PPC_UADDR32 (R_PPC64_UADDR64) has the same meaning as R_PPC_ADDR32
(R_PPC64_ADDR64), except that its address need not be aligned. For
powerpc64, BFD ld(1) will automatically convert between ADDR<->UADDR
relocations when the address is/isn't at its native alignment. This
will happen if, for example, there is a pointer in a packed struct.
gold and lld do not currently generate R_PPC64_UADDR64, but pass
through misaligned R_PPC64_ADDR64 relocations from object files,
possibly relaxing them to misaligned R_PPC64_RELATIVE. In both cases
(relaxed or not) this violates the PSABI, which defines the relevant
field type as "a 64-bit field occupying 8 bytes, the alignment of
which is 8 bytes unless otherwise specified."
All three linkers violate the PSABI on 32-bit powerpc, where the only
difference is that the field is 32 bits wide, aligned to 4 bytes.
Currently musl fails to load executables linked by BFD ld containing
R_PPC64_UADDR64, with the error "unsupported relocation type 43".
This change provides compatibility with BFD ld on powerpc64, and any
static linker on either architecture that starts following the PSABI
more closely.
do not use _Noreturn for a function pointer in dynamic linker 2019年06月21日T20:26:40+00:00 Matthew Maurer mmaurer@google.com 2019年06月13日T19:33:38+00:00 a48ccc159a5fa061a18419296100ee48a1cd6cc9 _Noreturn is a C11 construct, and may only be used at the site of a function definition.
_Noreturn is a C11 construct, and may only be used at the site of a
function definition.
reduce spurious inclusion of libc.h 2018年09月12日T18:34:37+00:00 Rich Felker dalias@aerifal.cx 2018年09月12日T04:08:09+00:00 5ce3737931bb411a8d167356d4d0287b53b0cbdc libc.h was intended to be a header for access to global libc state and related interfaces, but ended up included all over the place because it was the way to get the weak_alias macro. most of the inclusions removed here are places where weak_alias was needed. a few were recently introduced for hidden. some go all the way back to when libc.h defined CANCELPT_BEGIN and _END, and all (wrongly implemented) cancellation points had to include it. remaining spurious users are mostly callers of the LOCK/UNLOCK macros and files that use the LFS64 macro to define the awful *64 aliases. in a few places, new inclusion of libc.h is added because several internal headers no longer implicitly include libc.h. declarations for __lockfile and __unlockfile are moved from libc.h to stdio_impl.h so that the latter does not need libc.h. putting them in libc.h made no sense at all, since the macros in stdio_impl.h are needed to use them correctly anyway.
libc.h was intended to be a header for access to global libc state and
related interfaces, but ended up included all over the place because
it was the way to get the weak_alias macro. most of the inclusions
removed here are places where weak_alias was needed. a few were
recently introduced for hidden. some go all the way back to when
libc.h defined CANCELPT_BEGIN and _END, and all (wrongly implemented)
cancellation points had to include it.
remaining spurious users are mostly callers of the LOCK/UNLOCK macros
and files that use the LFS64 macro to define the awful *64 aliases.
in a few places, new inclusion of libc.h is added because several
internal headers no longer implicitly include libc.h.
declarations for __lockfile and __unlockfile are moved from libc.h to
stdio_impl.h so that the latter does not need libc.h. putting them in
libc.h made no sense at all, since the macros in stdio_impl.h are
needed to use them correctly anyway.

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