svn commit: r360306 - head/lib/libc/sys

Conrad Meyer cem at FreeBSD.org
Sat Apr 25 14:24:55 UTC 2020


Author: cem
Date: Sat Apr 25 14:24:54 2020
New Revision: 360306
URL: https://svnweb.freebsd.org/changeset/base/360306

Log:
  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

Modified:
  head/lib/libc/sys/openat.c
  head/lib/libc/sys/setcontext.c
  head/lib/libc/sys/swapcontext.c

Modified: head/lib/libc/sys/openat.c
==============================================================================
--- head/lib/libc/sys/openat.c	Sat Apr 25 13:18:29 2020	(r360305)
+++ head/lib/libc/sys/openat.c	Sat Apr 25 14:24:54 2020	(r360306)
@@ -43,6 +43,7 @@ __sym_compat(openat, __impl_openat, FBSD_1.1);
 __weak_reference(openat, __impl_openat);
 __sym_default(openat, openat, FBSD_1.2);
 
+#pragma weak openat
 int
 openat(int fd, const char *path, int flags, ...)
 {

Modified: head/lib/libc/sys/setcontext.c
==============================================================================
--- head/lib/libc/sys/setcontext.c	Sat Apr 25 13:18:29 2020	(r360305)
+++ head/lib/libc/sys/setcontext.c	Sat Apr 25 14:24:54 2020	(r360306)
@@ -42,6 +42,7 @@ __sym_compat(setcontext, __impl_setcontext, FBSD_1.0);
 __weak_reference(setcontext, __impl_setcontext);
 __sym_default(setcontext, setcontext, FBSD_1.2);
 
+#pragma weak setcontext
 int
 setcontext(const ucontext_t *uc)
 {

Modified: head/lib/libc/sys/swapcontext.c
==============================================================================
--- head/lib/libc/sys/swapcontext.c	Sat Apr 25 13:18:29 2020	(r360305)
+++ head/lib/libc/sys/swapcontext.c	Sat Apr 25 14:24:54 2020	(r360306)
@@ -43,6 +43,7 @@ __sym_compat(swapcontext, __impl_swapcontext, FBSD_1.0
 __weak_reference(swapcontext, __impl_swapcontext);
 __sym_default(swapcontext, swapcontext, FBSD_1.2);
 
+#pragma weak swapcontext
 int
 swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
 {


More information about the svn-src-all mailing list