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$: two-line .h patternRemove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
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-NetBSD identifier is obsolete, drop -NetBSDThe SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catchup to that fact and revert to their recommended match of BS
spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSDThe SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catchup to that fact and revert to their recommended match of BSD-2-Clause.Discussed with: pfgMFC After: 3 daysSponsored by: Netflix
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
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: 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-elf(1): remove obsolete pre_init() hookIt's no longer used since 600ee699ed2805894f5972c6ac2c3d17dca7f6ceand r358358 respectively.
Add CFI start/end proc directives to arm64, i386, and ppcFollow-up to r353959 and r368070: do the same for other architectures.arm32 already seems to use its own .fnstart/.fnend directives, which
Add CFI start/end proc directives to arm64, i386, and ppcFollow-up to r353959 and r368070: do the same for other architectures.arm32 already seems to use its own .fnstart/.fnend directives, whichappear to be ARM-specific variants of the same thing. Likewise, MIPSuses .frame directives.Reviewed by: arichardsonDifferential Revision: https://reviews.freebsd.org/D27387
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
[PowerPC] powerpc64 rtld IFUNC handling codeAs PowerPC is moving to clang, we can finally start taking advantage ofIFUNC.Implement the MD parts of IFUNC handling for rtld.Currently, it is nece
[PowerPC] powerpc64 rtld IFUNC handling codeAs PowerPC is moving to clang, we can finally start taking advantage ofIFUNC.Implement the MD parts of IFUNC handling for rtld.Currently, it is necessary to look for R_PPC_IRELATIVE in the PLT inaddition to RELA. This is an ABI violation, but LLD9 has some .iplt bugsthat require this as a workaround.Reviewed by: kibDifferential Revision: https://reviews.freebsd.org/D22789
[PPC64] Fix rtld direct exec modeInstead of restoring the saved values of argc, argv and envp,these must be loaded from the stack that _rtld() modifies.This fixes rtld direct exec mode.E.g.: /l
[PPC64] Fix rtld direct exec modeInstead of restoring the saved values of argc, argv and envp,these must be loaded from the stack that _rtld() modifies.This fixes rtld direct exec mode.E.g.: /libexec/ld-elf.so.1 /bin/lsReviewed by: jhibbitsDifferential Revision: https://reviews.freebsd.org/D21131
Fix rtld-elf compilation warning for powerpc64 ELFv2 ABISummary: reloc_jmpslot function parameter 'defobj' is not used when using ELFv2ABISubmitted by: alfredo.junior_eldorado.org.brReviewed By
Fix rtld-elf compilation warning for powerpc64 ELFv2 ABISummary: reloc_jmpslot function parameter 'defobj' is not used when using ELFv2ABISubmitted by: alfredo.junior_eldorado.org.brReviewed By: kib, git_bdragon.rtk0.net, emaste, jhibbitsDifferential Revision: https://reviews.freebsd.org/D18808
rtld-elf: Fix powerpc64 TLS handling, matching powerpc's fixWe need to subtract the TLS_TCB_SIZE to get to the real data pointer, sincer13 points to the end of the TCB structure. Prior to this, d
rtld-elf: Fix powerpc64 TLS handling, matching powerpc's fixWe need to subtract the TLS_TCB_SIZE to get to the real data pointer, sincer13 points to the end of the TCB structure. Prior to this, devel/protobuf-cport broke with recent update to devel/protobuf, which exposed this issue.Submitted by: andreastReported by: Piotr KubajMFC after: 1 week
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
Flush data cache for executable loadable segments explicitly.Do not use textsize and do not flush everything between map base andbase + textsize, because unmapped areas cannot be flushed.This ma
Flush data cache for executable loadable segments explicitly.Do not use textsize and do not flush everything between map base andbase + textsize, because unmapped areas cannot be flushed.This makes Obj_Entry textsize only use go away, and I will remove itlater.Reported by: tuexenTested by: Mark Millard <[email protected]>Sponsored by: The FreeBSD Foundation
rtld-elf: compile with WANRS=4 warnings other than -Wcast-alignReviewed By: kibApproved By: brooks (mentor)Differential Revision: https://reviews.freebsd.org/D17153
Rework rtld's TLS Variant I implementation to match r326794The above commit fixed handling overaligned TLS segments in libc'sTLS Variant I implementation, but rtld provides its own implementation
Rework rtld's TLS Variant I implementation to match r326794The above commit fixed handling overaligned TLS segments in libc'sTLS Variant I implementation, but rtld provides its own implementationfor dynamically-linked executables which lacks these fixes. Thus,port these changes to rtld.This was previously commited as r337978 and reverted in r338149 due toexposing a bug the ARM rtld. This bug was fixed in r338317 by mmel.Submitted by: James ClarkeApproved by: re (kib)Reviewed by: kbowlingTesting by: kbowling (powerpc64), br (riscv), kevans (armv7)Obtained from: CheriBSDSponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D16510
Revert r337978: Rework rtld's TLS Variant I implementation to match r326794Michal Meloun reports that it breaks ctype (isspace()..) relatedfunctions on armv7 so back out while we diagnose the issu
Revert r337978: Rework rtld's TLS Variant I implementation to match r326794Michal Meloun reports that it breaks ctype (isspace()..) relatedfunctions on armv7 so back out while we diagnose the issue.Reported by: Michal Meloun <[email protected]>
Rework rtld's TLS Variant I implementation to match r326794The above commit fixed handling overaligned TLS segments in libc'sTLS Variant I implementation, but rtld provides its own implementationfor dynamically-linked executables which lacks these fixes. Thus,port these changes to rtld.Submitted by: James ClarkeReviewed by: kbowlingTesting byL kbowling (powerpc64), br (riscv), kevans (armv7)Obtained from: CheriBSDSponsored by: DARPA, AFRLDifferential Revision: https://reviews.freebsd.org/D16510
123