#
33658afd |
| 22-Aug-2024 |
Jessica Clarke <jrtc27@FreeBSD.org> |
rtld-elf: Pass parsed aux_info to ifunc_init
Currently we pass the raw pointer to the on-stack auxargs. This can legitimately have fewer than AT_COUNT entries, so the use of __min_size(AT_COUNT), i.
rtld-elf: Pass parsed aux_info to ifunc_init
Currently we pass the raw pointer to the on-stack auxargs. This can legitimately have fewer than AT_COUNT entries, so the use of __min_size(AT_COUNT), i.e. static AT_COUNT, is inaccurate, and also needlessly forces the callee to iterate over the elements to find the entry for a given type. Instead we can just pass aux_info like we use for everything else.
Note that the argument has been left unused by every callee since its introduction in 4352999e0e6c ("Pass CPUID[1] %edx (cpu_feature), %ecx (cpu_feature2) and CPUID[7].%ebx (cpu_stdext_feature), %ecx (cpu_stdext_feature2) to the ifunc resolvers on x86.")
Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D46276
show more ...
|
#
5c2bc3db |
| 30-Jul-2024 |
Ed Maste <emaste@FreeBSD.org> |
Remove "All Rights Reserved" from FreeBSD Foundation copyrights
These ones were unambiguous cases where the Foundation was the only listed copyright holder.
Sponsored by: The FreeBSD Foundation
|
#
98200077 |
| 05-Jun-2024 |
Jessica Clarke <jrtc27@FreeBSD.org> |
rtld-elf: Use a proper struct type for tlsdesc entries
This clarifies the code and makes it less error-prone. It also makes it easier to extend downstream in CheriBSD (where pointer and integer memb
rtld-elf: Use a proper struct type for tlsdesc entries
This clarifies the code and makes it less error-prone. It also makes it easier to extend downstream in CheriBSD (where pointer and integer members no longer have the same representation and an additional member is present).
Reviewed by: jhb, kib Differential Revision: https://reviews.freebsd.org/D45143
show more ...
|
Revision tags: release/14.1.0 |
|
#
d51fa0a9 |
| 17-Apr-2024 |
Andrew Turner <andrew@FreeBSD.org> |
rtld: Add support for arm64 variant pcs
The aarch64 ELF spec has support for a variant of the normal procedure call standard that doesn't follow the normal register convention, e.g. using more regis
rtld: Add support for arm64 variant pcs
The aarch64 ELF spec has support for a variant of the normal procedure call standard that doesn't follow the normal register convention, e.g. using more registers as arguments, or different register state is preserved.
Add support to rtld to handle this. As we don't know which registers need to be preserved disable lazy binding for these functions.
Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44869
show more ...
|
Revision tags: release/13.3.0, release/14.0.0, release/13.2.0 |
|
#
d8925a5f |
| 05-Apr-2023 |
Andrew Turner <andrew@FreeBSD.org> |
Support BTI in rtld
Read the elf note to decide when to set the guard page on arm64.
Reviewed by: kib Sponsored by: Arm Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://revie
Support BTI in rtld
Read the elf note to decide when to set the guard page on arm64.
Reviewed by: kib Sponsored by: Arm Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39452
show more ...
|
#
a6fe717c |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
libexec: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
R
libexec: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
#
95335dd3 |
| 29-Oct-2023 |
Stephen J. Kiernan <stevek@FreeBSD.org> |
rtld: introduce STATIC_TLS_EXTRA
The new STATIC_TLS_EXTRA variable provides a means for applications to increases the size of the extra static TLS space allocated by rtld beyond the default of '128'
rtld: introduce STATIC_TLS_EXTRA
The new STATIC_TLS_EXTRA variable provides a means for applications to increases the size of the extra static TLS space allocated by rtld beyond the default of '128'. This extra static TLS space is used for objects loaded with dlopen.
The value specified in the variable must be no less than the default value and no greater than the maximum allowed value for size_t type.
If an invalid value is specified, rtld will ignore it and just use the default value.
The rtld(1) man page is updated to document this new option.
Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D42025
show more ...
|
#
1d386b48 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
283a4f40 |
| 05-Jun-2023 |
Konstantin Belousov <kib@FreeBSD.org> |
rtld: rename tls_done to tls_static
The meaning of the flag is that static TLS allocation was done.
Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.c rev. 1.18.
Sponsored
rtld: rename tls_done to tls_static
The meaning of the flag is that static TLS allocation was done.
Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.c rev. 1.18.
Sponsored by: The FreeBSD Foundation MFC after: 1 week
show more ...
|
Revision tags: release/12.4.0, release/13.1.0 |
|
#
8bcdb144 |
| 09-Dec-2021 |
John Baldwin <jhb@FreeBSD.org> |
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
show more ...
|
Revision tags: release/12.3.0 |
|
#
b928e924 |
| 18-Nov-2021 |
John Baldwin <jhb@FreeBSD.org> |
rtld-elf: Use _get_tp in __tls_get_addr for aarch64 and riscv64.
Reviewed by: kib Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D33047
|
#
f238ebd1 |
| 16-Jul-2021 |
Mark Johnston <markj@FreeBSD.org> |
rtld/arm64: Remove checks for undefined symbols when processing TPREL64
lld emits several GOT relocations referencing the null sumbol in libc.so when compiled with -ftls-model=initial-exec. This sy
rtld/arm64: Remove checks for undefined symbols when processing TPREL64
lld emits several GOT relocations referencing the null sumbol in libc.so when compiled with -ftls-model=initial-exec. This symbol is specified to be undefined.
We generally do not handle dynamic TLS relocations against weak, undefined symbols, so avoid printing a warning here. This makes it possible to compile libc.so using the initial-exec TLS model on arm64.
Reviewed by: jrtc27, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31069
show more ...
|
Revision tags: release/13.0.0 |
|
#
b58c853e |
| 24-Dec-2020 |
Marius Strobl <marius@FreeBSD.org> |
rtld-elf(1): remove obsolete pre_init() hook
It's no longer used since 600ee699ed2805894f5972c6ac2c3d17dca7f6ce and r358358 respectively.
|
Revision tags: release/12.2.0, release/11.4.0 |
|
#
74dc6beb |
| 14-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r357855 through r357920.
|
#
c5ca0d11 |
| 14-Feb-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
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: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D23652
show more ...
|
Revision tags: release/12.1.0, release/11.3.0 |
|
#
4849c3a5 |
| 15-Dec-2018 |
Michal Meloun <mmel@FreeBSD.org> |
Improve R_AARCH64_TLSDESC relocation. The original code did not support dynamically loaded libraries and used suboptimal 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 used suboptimal access to TLS variables. New implementation removes lazy resolving of TLS relocation - due to flaw in TLSDESC design is impossible to switch resolver function at runtime without 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, 232311 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18417
show more ...
|
#
67350cb5 |
| 09-Dec-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r340918 through r341763.
|
#
63003c4b |
| 08-Dec-2018 |
Michal Meloun <mmel@FreeBSD.org> |
Implement R_AARCH64_TLS_DTPMOD64 and A_AARCH64_TLS_DTPREL64 relocations. Although these are slightly obsolete in favor of R_AARCH64_TLSDESC, gcc -mtls-dialect=trad still use them.
Please note that d
Implement R_AARCH64_TLS_DTPMOD64 and A_AARCH64_TLS_DTPREL64 relocations. Although these are slightly obsolete in favor of R_AARCH64_TLSDESC, gcc -mtls-dialect=trad still use them.
Please note that definition of TLS_DTPMOD64 and TLS_DTPREL64 are incorrectly exchanged in GNU binutils. TLS_DTPREL64 should be encoded to 1028 (as is defined in ARM ELF ABI) but binutils encode it to 1029. And vice versa, TLS_DTPMOD64 should be encoded to 1029 but binutils encode it to 1028.
While I'm in, add also R_AARCH64_NONE. It can be produced as result of linker relaxation.
MFC after: 1 week
show more ...
|
Revision tags: release/12.0.0 |
|
#
419333b9 |
| 05-Dec-2018 |
Michal Meloun <mmel@FreeBSD.org> |
Tidy up arm64 reloc_jmpslots() implementation. - don't relocate jump slots multiple times (if LD_BIND_NOW is defined). - process only R_AARCH64_JUMP_SLOT here, other relocation types are handled by
Tidy up arm64 reloc_jmpslots() implementation. - don't relocate jump slots multiple times (if LD_BIND_NOW is defined). - process only R_AARCH64_JUMP_SLOT here, other relocation types are handled by reloc_plt().
MFC after: 1 week
show more ...
|
#
22e9ff95 |
| 05-Dec-2018 |
Michal Meloun <mmel@FreeBSD.org> |
Implement arm64 version of __tls_get_addr().
MFC after: 1 week
|
#
e8c479fd |
| 05-Dec-2018 |
Michal Meloun <mmel@FreeBSD.org> |
Fix style(9). Not a functional change.
MFC after: 1 week
|
#
2a22df74 |
| 04-Nov-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r339813 through r340125.
|
#
903e0ffd |
| 29-Oct-2018 |
Alex Richardson <arichardson@FreeBSD.org> |
rtld-elf: compile with WANRS=4 warnings other than -Wcast-align
Reviewed By: kib Approved By: brooks (mentor) Differential Revision: https://reviews.freebsd.org/D17153
|
#
c6879c6c |
| 23-Oct-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r339015 through r339669.
|
#
01d4e214 |
| 05-Oct-2018 |
Glen Barber <gjb@FreeBSD.org> |
MFH r338661 through r339200.
Sponsored by: The FreeBSD Foundation
|