#
860c4d94 |
| 17-Jul-2024 |
Konstantin Belousov <kib@FreeBSD.org> |
rtld: add LD_NO_DL_ITERATE_PHDR_AFTER_FORK env var
which makes threaded fork ignore the phdr rtld lock, in particular allowing the dl_iterate_phdr() to block in callback. The cost is that the image
rtld: add LD_NO_DL_ITERATE_PHDR_AFTER_FORK env var
which makes threaded fork ignore the phdr rtld lock, in particular allowing the dl_iterate_phdr() to block in callback. The cost is that the image started in this mode cannot use dl_iterate_phdr() after fork.
PR: 280318 Sponsored by: The FreeBSD Foundation MFC after: 1 week
show more ...
|
Revision tags: release/14.1.0, release/13.3.0, release/14.0.0 |
|
#
42b38843 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
Revision tags: release/13.2.0, release/12.4.0 |
|
#
7444f54b |
| 30-Aug-2022 |
Konstantin Belousov <kib@FreeBSD.org> |
rtld: style the rest of rtld_lock.c
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36396
|
#
a687683b |
| 30-Aug-2022 |
Konstantin Belousov <kib@FreeBSD.org> |
rtld: mask signals for default read locks
Rtld locks from libthr defer signals delivery, which means that binding is not possible while a signal handler is executed.
Binding might upgrade read-lock
rtld: mask signals for default read locks
Rtld locks from libthr defer signals delivery, which means that binding is not possible while a signal handler is executed.
Binding might upgrade read-locked rtld_bind_lock to write-lock, if symbol resolution requires loading filters. If a signal would be delivered while rtld is in read-locked section, and signal handler needs binding which upgrades the lock, for non-threaded image that uses default rtld locks, we get the rtld data structures modified under the top-level active rtld frame.
To correct the problem, mask signals for read-locking of default locks in addition to the write-locking. It is very cheap now with sigfastblock(2).
Note that the global state is used to track pre-locked state of either sigfastblock(2) or signal mask (if sigfastblock(2) is administratively disabled). It is fine for non-threaded images since there are no other threads. But I believe that it is fine for threaded images using libc_r as well, since masking signals disables preemption (I did not tested it).
NetBSD PR: https://gnats.netbsd.org/56979 Reported by: tmunro Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36396
show more ...
|
Revision tags: release/13.1.0, release/12.3.0 |
|
#
529ab5a7 |
| 12-May-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
rtld: initialize default dlerror_seen_val as true
There should be no error after startup.
PR: 255698 Reported by: Eugene M. Kim <astralblue@gmail.com> Sponsored by: The FreeBSD Foundation MFC after
rtld: initialize default dlerror_seen_val as true
There should be no error after startup.
PR: 255698 Reported by: Eugene M. Kim <astralblue@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 1 week
show more ...
|
Revision tags: release/13.0.0 |
|
#
4d9128da |
| 08-Apr-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
rtld: make dlerror() thread-local
PR: 95339 Discussed with: arichardson Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29633
|
#
08bfbd43 |
| 10-Apr-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
rtld: workaround for broken ABI
Right now, libthr does not initialize RtldLockInfo.rtli_version when calling _rtld_thread_init(), which makes versioning the interface troublesome.
Add a workaround:
rtld: workaround for broken ABI
Right now, libthr does not initialize RtldLockInfo.rtli_version when calling _rtld_thread_init(), which makes versioning the interface troublesome.
Add a workaround: if the calling object of _rtld_thread_init() exports the "_pli_rtli_version" symbol, then consider rtli_version initialized. Otherwise, forcibly set it to RTLI_VERSION_ONE, currently defined as RTLI_VERSION.
Export "_pli_rtli_version" from libthr and properly initialize rtli_version.
Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29633
show more ...
|
#
4d7f08c8 |
| 10-Apr-2021 |
Konstantin Belousov <kib@FreeBSD.org> |
rtld: unstaticise lockinfo and obj_from_addr()
Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29633
|
Revision tags: release/12.2.0, release/11.4.0 |
|
#
44e86fbd |
| 13-Feb-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r357662 through r357854.
|
#
aef199e5 |
| 09-Feb-2020 |
Konstantin Belousov <kib@FreeBSD.org> |
Use sigfastblock(2) in rtld.
This allows for rtld to not issue two sigprocmask(2) syscalls for each symbol binding operation in single-threaded processes. Rtld needs to block signals as part of loc
Use sigfastblock(2) in rtld.
This allows for rtld to not issue two sigprocmask(2) syscalls for each symbol binding operation in single-threaded processes. Rtld needs to block signals as part of locking to ensure signal safety of the bind process, because signal handlers might need to lazily resolve symbol references.
As result, number of syscalls issued on startup by simple programs not using libthr, is typically reduced 2x. For instance, for hello world, I see: non-sigfastblock # (truss ./hello > /dev/null) |& wc -l 63 sigfastblock # (truss ./hello > /dev/null) |& wc -l 37
Tested by: pho Disscussed with: cem, emaste, jilles Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D12773
show more ...
|
Revision tags: release/12.1.0 |
|
#
a63915c2 |
| 28-Jul-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @r350386
Sponsored by: The FreeBSD Foundation
|
Revision tags: release/11.3.0 |
|
#
b54a59f3 |
| 30-Jun-2019 |
Alex Richardson <arichardson@FreeBSD.org> |
Reduce size of rtld by 22% by pulling in less code from libc
Currently RTLD is linked against libc_nossp_pic which means that any libc symbol used in rtld can pull in a lot of depedencies. This was
Reduce size of rtld by 22% by pulling in less code from libc
Currently RTLD is linked against libc_nossp_pic which means that any libc symbol used in rtld can pull in a lot of depedencies. This was causing symbol such as __libc_interposing and all the pthread stubs to be included in RTLD even though they are not required. It turns out most of these dependencies can easily be avoided by providing overrides inside of rtld.
This change is motivated by CHERI, where we have an experimental ABI that requires additional relocation processing to allow the use of function pointers inside of rtld. Instead of adding this self-relocation code to RTLD I attempted to remove most function pointers from RTLD and discovered that most of them came from the libc dependencies instead of being actually used inside rtld.
A nice side-effect of this change is that rtld is now 22% smaller on amd64.
text data bss dec hex filename 0x21eb6 0xce0 0xe60 145910 239f6 /home/alr48/ld-elf-x86.before.so.1 0x1a6ed 0x728 0xdd8 113645 1bbed /home/alr48/ld-elf-x86.after.so.1
The number of R_X86_64_RELATIVE relocations that need to be processed on startup has also gone down from 368 to 187 (almost 50% less).
Reviewed By: kib Differential Revision: https://reviews.freebsd.org/D20663
show more ...
|
Revision tags: release/12.0.0 |
|
#
2a22df74 |
| 04-Nov-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r339813 through r340125.
|
#
3ab5b6bd |
| 29-Oct-2018 |
Alex Richardson <arichardson@FreeBSD.org> |
rtld-elf: fix more warnings to allow compiling with WARNS=6
Reviewed By: kib Approved By: brooks (mentor) Differential Revision: https://reviews.freebsd.org/D17154
|
Revision tags: release/11.2.0 |
|
#
e6209940 |
| 27-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
libexec: adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone -
libexec: adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
No functional change intended.
show more ...
|
Revision tags: release/10.4.0, release/11.1.0 |
|
#
8a6fe8ce |
| 11-Jan-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r311812 through r311939.
|
#
b88a8d3d |
| 10-Jan-2017 |
Konstantin Belousov <kib@FreeBSD.org> |
Fix acquisition of nested write compat rtld locks.
Obtaining compat rtld lock in write mode sets process signal mask to block all signals. Previous mask is stored in the global variable oldsigmask.
Fix acquisition of nested write compat rtld locks.
Obtaining compat rtld lock in write mode sets process signal mask to block all signals. Previous mask is stored in the global variable oldsigmask. If a lock is write-locked while another lock is already write-locked, oldsigmask is overwritten by the total mask and on the last unlock, all signals except traps appear to be blocked.
Fix this by counting the write-lock nested level, and only storing to oldsigmask/restoring from it at the outermost level.
Masking signals disables involuntary preemption for libc_r, and there could be no voluntary context switches in the locked code (dl_iterate_phdr(3) keeps a lock around user callback, but it was added long after libc_r was renounced). Due to this, remembering the level in the global variable after the lock is obtained should be safe, because no two libc_r threads can acquire different write locks in parallel.
PR: 215826 Reported by: kami Tested by: yamagi@yamagi.org (previous version) To be reviewed by: kan Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
show more ...
|
#
e7bfd34b |
| 10-Jan-2017 |
Konstantin Belousov <kib@FreeBSD.org> |
Use ANSI C definitions, update comment.
Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
Revision tags: release/11.0.1, release/11.0.0, release/10.3.0, release/10.2.0 |
|
#
416ba5c7 |
| 22-Jun-2015 |
Navdeep Parhar <np@FreeBSD.org> |
Catch up with HEAD (r280229-r284686).
|
#
98e0ffae |
| 27-May-2015 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Merge sync of head
|
#
7263c8c0 |
| 22-Apr-2015 |
Glen Barber <gjb@FreeBSD.org> |
MFH: r280643-r281852
Sponsored by: The FreeBSD Foundation
|
#
4bf53d0b |
| 04-Apr-2015 |
Baptiste Daroussin <bapt@FreeBSD.org> |
Merge from HEAD
|
#
0c4f9ecd |
| 29-Mar-2015 |
Konstantin Belousov <kib@FreeBSD.org> |
Change compiler setting to make default visibility of the symbols for rtld on x86 to be hidden. This is a micro-optimization, which allows intrinsic references inside rtld to be handled without indi
Change compiler setting to make default visibility of the symbols for rtld on x86 to be hidden. This is a micro-optimization, which allows intrinsic references inside rtld to be handled without indirection through PLT. The visibility of rtld symbols for other objects in the symbol namespace is controlled by a version script.
Reviewed by: kan, jilles Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
show more ...
|
Revision tags: release/10.1.0 |
|
#
ee7b0571 |
| 19-Aug-2014 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Merge head from 7/28
|