| #
b59aecef
|
| 06-Aug-2025 |
Brooks Davis <brooks@FreeBSD.org> |
libc: stop trying to create __<syscall> symbols
When we switched to an interposing table (commit 8495e8b1e9e1) for cancelation points we stopped having concrete implementations of __<syscall> and in
libc: stop trying to create __<syscall> symbols
When we switched to an interposing table (commit 8495e8b1e9e1) for cancelation points we stopped having concrete implementations of __<syscall> and instead use __sys_<syscall> and __thr_<syscall>. These entries of the form:
__weak_reference(__sys_<syscall>, __<syscall>);
seem to be intended to preserve these symbols, but they have no effect as __sys_<syscall> isn't defined in the translation units in question.
Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D51668
show more ...
|
| #
6e83504c
|
| 19-Apr-2024 |
Brooks Davis <brooks@FreeBSD.org> |
Revert "lib{c,sys}: normalize export of openat, setcontext, and swapcontext"
I put the symbols in the wrong file (should have been lib/libc/sys/Symbol.map), added a duplicate pdfork entry due to a b
Revert "lib{c,sys}: normalize export of openat, setcontext, and swapcontext"
I put the symbols in the wrong file (should have been lib/libc/sys/Symbol.map), added a duplicate pdfork entry due to a botch rebase, and there seems to be a issue with gcc13/binutils not exposing the symbols so revert the whole thing while I debug.
This reverts commit ee632fb9eb4a060a4087a7f5425bfe36e65cda61.
show more ...
|
| #
ee632fb9
|
| 16-Apr-2024 |
Brooks Davis <brooks@FreeBSD.org> |
lib{c,sys}: normalize export of openat, setcontext, and swapcontext
List them in the symbol map rather than using the __sym_default to expose them. This will allow later improvements in the stub im
lib{c,sys}: normalize export of openat, setcontext, and swapcontext
List them in the symbol map rather than using the __sym_default to expose them. This will allow later improvements in the stub implementations in libc.so.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44113
show more ...
|
| #
7dd9070e
|
| 16-Apr-2024 |
Brooks Davis <brooks@FreeBSD.org> |
libc: INTERPOS_SYS macro for interposed syscalls
This macro makes uses the __sys_<foo>_t typedefs from libsys.h to greatly simplify calling functions in the interposing table.
Reviewed by: kib Diff
libc: INTERPOS_SYS macro for interposed syscalls
This macro makes uses the __sys_<foo>_t typedefs from libsys.h to greatly simplify calling functions in the interposing table.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44389
show more ...
|
| #
d7847a8d
|
| 13-Mar-2024 |
Brooks Davis <brooks@FreeBSD.org> |
lib{c,sys}: return wrapped syscall APIs to libc
These provide standard APIs, but are implemented using another system call (e.g., pipe implemented in terms of pipe2) or are interposed by the threadi
lib{c,sys}: return wrapped syscall APIs to libc
These provide standard APIs, but are implemented using another system call (e.g., pipe implemented in terms of pipe2) or are interposed by the threading library to support cancelation.
After discussion with kib (see D44111), I've concluded that it is better to keep most public interfaces in libc with as little as possible in libsys.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44241
show more ...
|
| #
ef5fddd3
|
| 13-Mar-2024 |
Brooks Davis <brooks@FreeBSD.org> |
libsys: make __libsys_interposing static
Access __libsys_interposing with __libc_interposing_slot() in all cases to support a move of these wrappers back to libc.
Reviewed by: kib Differential Revi
libsys: make __libsys_interposing static
Access __libsys_interposing with __libc_interposing_slot() in all cases to support a move of these wrappers back to libc.
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44239
show more ...
|
| #
8269e767
|
| 14-Nov-2023 |
Brooks Davis <brooks@FreeBSD.org> |
libsys: relocate implementations and manpages
Remove core system call implementations and documentation to lib/libsys and lib/libsys/<arch> from lib/libc/sys and lib/libc/<arch>/<sys>. Update paths
libsys: relocate implementations and manpages
Remove core system call implementations and documentation to lib/libsys and lib/libsys/<arch> from lib/libc/sys and lib/libc/<arch>/<sys>. Update paths to allow libc to find them in their new home.
Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
show more ...
|
| #
9cbd9658
|
| 16-Jan-2024 |
Brooks Davis <brooks@FreeBSD.org> |
libc: split libc and syscall interposing (1/2)
System calls or their wrappers are now interposed by __libsys_interposing with purely libc entries remaining in __libc_interposing.
Use __libsys_inter
libc: split libc and syscall interposing (1/2)
System calls or their wrappers are now interposed by __libsys_interposing with purely libc entries remaining in __libc_interposing.
Use __libsys_interposing_slot in libthr to update __libsys_interposing, but also make __libc_interposing_slot fall back to __libsys_interposing_slot so an out of date libc has a chance of working during updates.
Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
show more ...
|
| #
559a218c
|
| 01-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
libc: Purge unneeded cdefs.h
These sys/cdefs.h are not needed. Purge them. They are mostly left-over from the $FreeBSD$ removal. A few in libc are still required for macros that cdefs.h defines. Kee
libc: Purge unneeded cdefs.h
These sys/cdefs.h are not needed. Purge them. They are mostly left-over from the $FreeBSD$ removal. A few in libc are still required for macros that cdefs.h defines. Keep those.
Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42385
show more ...
|
| #
1d386b48
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| #
1e72c52e
|
| 25-Apr-2020 |
Conrad Meyer <cem@FreeBSD.org> |
libc: partially revert r326576
In r326576 ("use @@@ instead of @@ in __sym_default"), an earlier version of the phabricator-discussed patch was inadvertently committed. The commit message claims th
libc: partially revert r326576
In r326576 ("use @@@ instead of @@ in __sym_default"), an earlier version of the phabricator-discussed patch was inadvertently committed. The commit message claims that @@@ means that weak is not needed, but that was due to a misunderstanding of the use of weak symbols in this context by the submitted in the first draft of the patch; the description text was not updated to match the discussion. As discussed in phabricator, weak is needed for symbol interposing because of the behavior of our rtld, and is widely used elsewhere in libc.
This partial revert restores the approved version of the patch and permits symbol interposing for openat.
Reported by: Raymond Ramsden <rramsden AT isilon.com> Reviewed by: dim, emaste, kib (2017) Discussed with: kib (2020) Differential Revision: https://reviews.freebsd.org/D11653
show more ...
|
| #
19164ee6
|
| 05-Dec-2017 |
Ed Maste <emaste@FreeBSD.org> |
use @@@ instead of @@ in __sym_default
Using .symver foo,foo@@VER causes foo and foo@@VER to be output to the .o file. This requires foo to be weak since the linker handles foo@@VER as foo.
Usi
use @@@ instead of @@ in __sym_default
Using .symver foo,foo@@VER causes foo and foo@@VER to be output to the .o file. This requires foo to be weak since the linker handles foo@@VER as foo.
Using .symver foo,foo@@@VER causes just foo@@ver to be output and avoid the need for making foo weak. It also reduces the constraint on how exactly a linker has to handle foo and foo@@VER being present.
Submitted by: Rafael Espíndola Reviewed by: dim, kib Differential Revision: https://reviews.freebsd.org/D11653
show more ...
|
| #
8495e8b1
|
| 03-Jan-2015 |
Konstantin Belousov <kib@FreeBSD.org> |
Fix known issues which blow up the process after dlopen("libthr.so") (or loading a dso linked to libthr.so into process which was not linked against threading library).
- Remove libthr interposers o
Fix known issues which blow up the process after dlopen("libthr.so") (or loading a dso linked to libthr.so into process which was not linked against threading library).
- Remove libthr interposers of the libc functions, including __error(). Instead, functions calls are indirected through the interposing table, similar to how pthread stubs in libc are already done. Libc by default points either to syscall trampolines or to existing libc implementations. On libthr load, libthr rewrites the pointers to the cancellable implementations already in libthr. The interposition table is separate from pthreads stubs indirection table to not pull pthreads stubs into static binaries.
- Postpone the malloc(3) internal mutexes initialization until libthr is loaded. This avoids recursion between calloc(3) and static pthread_mutex_t initialization.
- Reinstall signal handlers with wrapper on libthr load. The _rtld_is_dlopened(3) is used to avoid useless calls to sigaction(2) when libthr is statically referenced from the main binary.
In the process, fix openat(2), swapcontext(2) and setcontext(2) interposing. The libc symbols were exported at different versions than libthr interposers. Export both libc and libthr versions from libc now, with default set to the higher version from libthr.
Remove unused and disconnected swapcontext(3) userspace implementation from libc/gen.
No objections from: deischen Tested by: pho, antoine (exp-run) (previous versions) Sponsored by: The FreeBSD Foundation MFC after: 1 week
show more ...
|
| #
4ed3c94b
|
| 20-Sep-2002 |
Jonathan Mini <mini@FreeBSD.org> |
Don't peek into MD structures from MI code. The getcontext(3) and setcontext(3) functions check the validify of the mcontext_t structs.
|
| #
6064ca52
|
| 17-Sep-2002 |
Peter Wemm <peter@FreeBSD.org> |
Bandaid to stop failing on non-i386 platforms. Add a big ugly #warning as a reminder.
|
| #
b3466b3f
|
| 16-Sep-2002 |
Jonathan Mini <mini@FreeBSD.org> |
Add signalcontext(), which lays down a signal frame onto a ucontext_t.
Reviewed by: deischen, julian Approved by: -arch
|
| #
aee4cebf
|
| 11-Jan-2002 |
Daniel Eischen <deischen@FreeBSD.org> |
Include <stddef.h> to fix build problem when namespace pollution by <signal.h> (including <time.h> so that NULL is accidentally defined) is removed.
Style nits.
Submitted by: bde
|
| #
b66b8326
|
| 10-Jan-2002 |
Daniel Eischen <deischen@FreeBSD.org> |
Add getcontext, setcontext, makecontext, and swapcontext. These functions are defined in SUSv2 and the latest POSIX spec.
Thanks to Bernd Walter <ticso@cicely8.cicely.de> for helping debug my alpha
Add getcontext, setcontext, makecontext, and swapcontext. These functions are defined in SUSv2 and the latest POSIX spec.
Thanks to Bernd Walter <ticso@cicely8.cicely.de> for helping debug my alpha assembly.
Approved by: -arch
show more ...
|