libc/csu: Pass HWCAP flags to ifunc resolver functionsFunction arguments are based on Section 9.4.1 "GNU C Library IFUNC interface"from "System V ABI for the Arm 64-bit Architecture (AArch64)", 20
libc/csu: Pass HWCAP flags to ifunc resolver functionsFunction arguments are based on Section 9.4.1 "GNU C Library IFUNC interface"from "System V ABI for the Arm 64-bit Architecture (AArch64)", 2025Q1.(https://github.com/ARM-software/abi-aa/releases/download/2025Q1/sysvabi64.pdf)Reviewed by: andrewSponsored by: Arm LtdDifferential Revision: https://reviews.freebsd.org/D54599
show more ...
libc/csu: Unify INIT_RELOCS across architecturesSome architectures don't need any arguments, whilst others need auxargs,which they get by passing in env thanks to INIT_RELOCS referencing thelocal
libc/csu: Unify INIT_RELOCS across architecturesSome architectures don't need any arguments, whilst others need auxargs,which they get by passing in env thanks to INIT_RELOCS referencing thelocal variable in __libc_start1(_gcrt) by name. This is unnecessarilyconfusing, fragile (one has to look at INIT_IRELOCS's definition to seethat it uses env) and duplicates code between architectures.Instead, implement it more like rtld-elf. Each architecture provides anifunc_init that takes the auxargs directly, and those that don't need itcan just ignore it.Reviewed by: kibMFC after: 1 monthDifferential Revision: https://reviews.freebsd.org/D47188
libc: Purge unneeded cdefs.hThese sys/cdefs.h are not needed. Purge them. They are mostly left-overfrom the $FreeBSD$ removal. A few in libc are still required for macrosthat cdefs.h defines. Kee
libc: Purge unneeded cdefs.hThese sys/cdefs.h are not needed. Purge them. They are mostly left-overfrom the $FreeBSD$ removal. A few in libc are still required for macrosthat cdefs.h defines. Keep those.Sponsored by: NetflixDifferential Revision: https://reviews.freebsd.org/D42385
Remove $FreeBSD$: one-line .c patternRemove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
csu: move common code to libcWhy? Most trivial point, it shaves around 600 bytes from the dynamicbinaries on amd64. Less trivial, the removed code is no longer part ofthe ABI, and we can ship upd
csu: move common code to libcWhy? Most trivial point, it shaves around 600 bytes from the dynamicbinaries on amd64. Less trivial, the removed code is no longer part ofthe ABI, and we can ship updates to it with libc updates. Right now mostof the csu is linked into the binaries and require us to do somewhattricky ABI compat when it needs to change. For instance, the init_arraychange would be much simpler and does not require note tagging if wehave init calling code in libc.This could be improved more, by splitting dynamic and staticinitialization. For instance, &_DYNAMIC tests can be removed then.Such change, nonetheless, would require building libc three times.I left this for later, after this change stabilizes, if ever.Reviewed by: markjDiscussed with: jrtc27 (some objections, see the review), impTested by: markj (aarch64)Sponsored by: The FreeBSD FoundationMFC after: 3 weeksDifferential revision: https://reviews.freebsd.org/D37220