summaryrefslogtreecommitdiff
path: root/lib/libc/sys/swapcontext.c
Commit message (Collapse)AuthorAgeFilesLines
* libc: partially revert r326576Conrad Meyer2020-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=360306
* use @@@ instead of @@ in __sym_defaultEd Maste2017-12-051-1/+0
| | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=326576
* Fix known issues which blow up the process after dlopen("libthr.so")Konstantin Belousov2015-01-031-0/+53
(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 Notes: svn path=/head/; revision=276630