From owner-svn-src-all@freebsd.org Sat Apr 25 14:24:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E13052B33F2; Sat, 25 Apr 2020 14:24:55 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 498YGH5cNNz47kx; Sat, 25 Apr 2020 14:24:55 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B76A98FFE; Sat, 25 Apr 2020 14:24:55 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03PEOt9k025627; Sat, 25 Apr 2020 14:24:55 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03PEOtlF025624; Sat, 25 Apr 2020 14:24:55 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202004251424.03PEOtlF025624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 25 Apr 2020 14:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360306 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 360306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Apr 2020 14:24:55 -0000 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 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) {