rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_EntryAdd a macro the architectures can use to add per-arch fields toStruct_Obj_Entry.Reviewed by: kibSponsored by: Arm LtdDifferential Revision: htt
rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_EntryAdd a macro the architectures can use to add per-arch fields toStruct_Obj_Entry.Reviewed by: kibSponsored by: Arm LtdDifferential Revision: https://reviews.freebsd.org/D45116(cherry picked from commit 06db20ffeca9898e5802d63f3b06caaa37c3a4ed)
show more ...
rtld: introduce STATIC_TLS_EXTRA(cherry picked from commit 95335dd3c19e0ade161bb4dc8462fc3d045ce4f8)
Remove $FreeBSD$: one-line sh patternRemove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
Remove $FreeBSD$: one-line .c patternRemove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
Remove $FreeBSD$: two-line .h patternRemove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
rtld-elf: Remove set but unused variable on 32-bit arm.
rtld: rename tls_done to tls_staticThe meaning of the flag is that static TLS allocation was done.Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.crev. 1.18.Sponsored
rtld: rename tls_done to tls_staticThe meaning of the flag is that static TLS allocation was done.Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.crev. 1.18.Sponsored by: The FreeBSD FoundationMFC after: 1 week
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDThe SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catchup to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDThe SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catchup to that fact and revert to their recommended match of BSD-2-Clause.Discussed with: pfgMFC After: 3 daysSponsored by: Netflix
rtld: Revert "When loading dso without PT_GNU_STACK phdr, only call"After the removal of ia64 and sparc64, all current architecturessupport executable stacks at an architectural level.This rever
rtld: Revert "When loading dso without PT_GNU_STACK phdr, only call"After the removal of ia64 and sparc64, all current architecturessupport executable stacks at an architectural level.This reverts commit 1290d38ac50b3afa7e5781d9d97346a1042c736c.Reviewed by: kibSponsored by: DARPADifferential Revision: https://reviews.freebsd.org/D37904
rtld-elf: Remove libsoft supportRemove support for loading libsoft libraries.Sponsored by: Netflix
TLS: Use <machine/tls.h> for libc and rtld.- Include <machine/tls.h> in MD rtld_machdep.h headers.- Remove local definitions of TLS_* constants from rtld_machdep.h headers and libc using the va
TLS: Use <machine/tls.h> for libc and rtld.- Include <machine/tls.h> in MD rtld_machdep.h headers.- Remove local definitions of TLS_* constants from rtld_machdep.h headers and libc using the values from <machine/tls.h> instead.- Use _tcb_set() instead of inlined versions in MD allocate_initial_tls() routines in rtld. The one exception is amd64 whose _tcb_set() invokes the amd64_set_fsbase ifunc. rtld cannot use ifuncs, so amd64 inlines the logic to optionally write to fsbase directly.- Use _tcb_set() instead of _set_tp() in libc.- Use '&_tcb_get()->tcb_dtv' instead of _get_tp() in both rtld and libc. This permits removing _get_tp.c from rtld.- Use TLS_TCB_SIZE and TLS_TCB_ALIGN with allocate_tls() in MD allocate_initial_tls() routines in rtld.Reviewed by: kib, jrtc27 (earlier version)Differential Revision: https://reviews.freebsd.org/D33353
rtld-elf/paths.h: Make it usable outside rtldbut still for tightly coupled things like ldd(1)Rename paths.h to rtld_paths.h.Add guard for rtld-specific externs declarations.Add _COMPAT32_BASENA
rtld-elf/paths.h: Make it usable outside rtldbut still for tightly coupled things like ldd(1)Rename paths.h to rtld_paths.h.Add guard for rtld-specific externs declarations.Add _COMPAT32_BASENAME_RTLD and _COMPAT32_PATH_RTLD.Reviewed by: arichardson, jhbSponsored by: The FreeBSD FoundationMFC after: 1 weekDifferential revision: https://reviews.freebsd.org/D32464
rtld: rework how environment variables are namedInstead of specifying the main name part of the environment variable as thestring literal, create array of the var names and access them by symbolic
rtld: rework how environment variables are namedInstead of specifying the main name part of the environment variable as thestring literal, create array of the var names and access them by symbolicindex. Convert main name parts into complete names by prefixing withABI-specific ld_env_vars.This way the name is not repeated, and also it can carry additionalproporties explicitly. For instance, cleanup of the environment forthe setuid image does not require retyping all names.Reviewed by: arichardson, markjMFC after: 1 weekSponsored by: The FreeBSD FoundationDifferential revision: https://reviews.freebsd.org/D31545
rtld: Remove calculate_tls_endVariant I architectures use off and Variant II ones use size + off.Define TLS_VARIANT_I/TLS_VARIANT_II symbols similarly to how libchandles it.Reviewed by: kibMFC
rtld: Remove calculate_tls_endVariant I architectures use off and Variant II ones use size + off.Define TLS_VARIANT_I/TLS_VARIANT_II symbols similarly to how libchandles it.Reviewed by: kibMFC after: 1 weekDifferential revision: https://reviews.freebsd.org/D31539Differential revision: https://reviews.freebsd.org/D31541
rtld: define TLS_DTV_OFFSET on all architecturesSponsored by: The FreeBSD FoundationMFC after: 1 weekDifferential revision: https://reviews.freebsd.org/D29623
Remove the last users of ARM_TP_ADDRESSThis was only needed on 32-bit arm prior to ARMv6. As we only supportARMv6 or later remove it.Reviewed by: mannuSponsored by: Innovate UKDifferential Rev
Remove the last users of ARM_TP_ADDRESSThis was only needed on 32-bit arm prior to ARMv6. As we only supportARMv6 or later remove it.Reviewed by: mannuSponsored by: Innovate UKDifferential Revision: https://reviews.freebsd.org/D29624
rtld-elf: link libcompiler_rt on all architecturesStatically link rtld-elf with libcompiler_rt on all architectures sothat we don't need to try to pick and choose the bits we need from itfor each
rtld-elf: link libcompiler_rt on all architecturesStatically link rtld-elf with libcompiler_rt on all architectures sothat we don't need to try to pick and choose the bits we need from itfor each architecture (we now leave that to the linker). Compilers mayemit calls to support functions in this library, but because of the useof the linker flag -nostdlib for rtld's special needs, the library isnot linked as normal.Previously we had two different solutions. On some architectures, wewere able to extract reimplementations of the necessary builtinfunctions from our special build of libc. On ARM, we just linkedlibcompiler_rt.This is motivated by the same issue as D26199 and D27665, but should bea simpler solution that will apply to all architectures.Reviewed by: arichardson, kibSponsored by: Dell EMC IsilonDifferential Revision: https://reviews.freebsd.org/D27736
rtld-elf(1): remove obsolete pre_init() hookIt's no longer used since 600ee699ed2805894f5972c6ac2c3d17dca7f6ceand r358358 respectively.
Move ARM specific flags to arm/Makefile.incRequested by: kibMFC with: r360463
Align initial-exec TLS segments to the p_vaddr % align.This is continuation of D21163/r359634, which handled the alignmentfor global mode.Non-x86 arches are not handled, maintainers are welcomed
Align initial-exec TLS segments to the p_vaddr % align.This is continuation of D21163/r359634, which handled the alignmentfor global mode.Non-x86 arches are not handled, maintainers are welcomed.Tested by: emasteSponsored by: The FreeBSD FoundationMFC after: 2 weeksDifferential revision: https://reviews.freebsd.org/D24366
Handle non-plt IRELATIVE relocations, at least for x86.lld 10.0 seems to generate this relocation for rdtsc_mb() ifunc in our libc.Reported, reviewed, and tested by: dim (amd64, previous version)
Handle non-plt IRELATIVE relocations, at least for x86.lld 10.0 seems to generate this relocation for rdtsc_mb() ifunc in our libc.Reported, reviewed, and tested by: dim (amd64, previous version)Discussed with: emasteSponsored by: The FreeBSD FoundationMFC after: 1 weekDifferential revision: https://reviews.freebsd.org/D23652
rtld: clean up Makefile.Move all MD statements into $MACHINE_ARCH/Makefile.inc.Unconditionally apply version script to rtld, the interpreter is notfunctional without it for long time.Reviewed b
rtld: clean up Makefile.Move all MD statements into $MACHINE_ARCH/Makefile.inc.Unconditionally apply version script to rtld, the interpreter is notfunctional without it for long time.Reviewed by: brooks, emasteSponsored by: The FreeBSD FoundationDifferential revision: https://reviews.freebsd.org/D23083
rtld: attempt to fix reloc_nonplt_object TLS allocationallocate_tls_offset returns true on success. This still needs moretesting and review, but this change is consistent with other archs.PR:
rtld: attempt to fix reloc_nonplt_object TLS allocationallocate_tls_offset returns true on success. This still needs moretesting and review, but this change is consistent with other archs.PR: 236880Reported by: Andrew Gierth <[email protected]>MFC after: 2 weeksSponsored by: The FreeBSD Foundation
Improve R_AARCH64_TLSDESC relocation.The original code did not support dynamically loaded libraries and usedsuboptimal access to TLS variables.New implementation removes lazy resolving of TLS relo
Improve R_AARCH64_TLSDESC relocation.The original code did not support dynamically loaded libraries and usedsuboptimal access to TLS variables.New implementation removes lazy resolving of TLS relocation - due to flawin TLSDESC design is impossible to switch resolver function at runtimewithout expensive locking.Due to this, 3 specialized resolvers are implemented: - load time resolver for TLS relocation from libraries loaded with main executable (thus with known TLS offset). - resolver for undefined thread weak symbols. - slower lazy resolver for dynamically loaded libraries with fast path for already resolved symbols.PR: 228892, 232149, 233204, 232311MFC after: 2 weeksDifferential Revision: https://reviews.freebsd.org/D18417
rtld-elf: compile with WANRS=4 warnings other than -Wcast-alignReviewed By: kibApproved By: brooks (mentor)Differential Revision: https://reviews.freebsd.org/D17153
123