From nobody Sun Jul 07 23:47:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WHP7H73Nzz5QNDk; Sun, 07 Jul 2024 23:47:23 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WHP7H6H9Rz4gc3; Sun, 7 Jul 2024 23:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720396043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k9X78hr07sZgKwAOWzweNgppgBXSPZU3MBslctjE6tg=; b=aTREN9lPxr9Dvc6KU6dlZakIsymSXXwQagJ9y5DqRH5Rc3fuy2s2CMcxS3wuGRwcV7bn+2 2BNmxqQQtAPqigNWAwWD2E59IzyBdInl754QllFqNJQNE8HXBUkZ+T0lF3qmVgVE0+rDa2 qZYfb2sKVqG7kg8b5o36hWxMvjKykHjbryER3JiUDoy57EH59N9aZPDcZvCMyDKA7N29rP PX8d/UZ8NjMuEWXbkc3VNHZiUpXtY/fCtlOxw9cVKC03+0twSL8gc8vDpA9asy9r5eVPcB 25rwTkk5CAszeup5RExmJwU3UsqPyLLUSR2jV2g+WrntmyfClMrts/Wwte6drg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720396043; a=rsa-sha256; cv=none; b=Dfh5ONTNX9a+Zw3IXd60SrbFljbnz1H2QKvYRke19G6wmWlcaH9tRFyRdAZ9FkbU4z56ko q15zzssLbHWK6afszLjbgADIhDCfrsjMUFvl+/ADCCGdfc8rrXGbxHysRdUHh65iLtKVtG ip6cYKCbbnRBaID3iQEKSDHhvnjMY6VntzjlmBEJ3pL6P/6cX8M1osDphkZFze7Sf4H9pz 5CKksbm50NZpT8bs+4ze0YiaYodI9j9PZPXieGU9saWBn74mwcoL3YWqGLfbtGdIQZDEW8 sn1YOOY6Xkt7pV7v17Yr/k90cbl4k6JwM/Q+ot0JfE2UhwpvJ/U8Dhb+wBNsMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720396043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k9X78hr07sZgKwAOWzweNgppgBXSPZU3MBslctjE6tg=; b=cUks1gRFKhu2Hk+NEBAAwQ+wHANp6EPTieckDWNdsyLfaeq2BGOEMeFQHmou3bppbb/u2/ LyDhurZuDwPRsaUUAnrrdUTF8ve+GYlKkiT9xZ4Hn3AigoZ1y4a9lE9TgUl5jPURtqEyt4 PUyCDYwPgqpKvtT+rPyas7llow2/uTlFN8ozldFvc2kdDmfIXohIEo9xg4GrTj1lAe24yI tFk/vWXfa/3ZWodLrLfeEAF94vliRIVfpVfcFuaIRaNZrAd1bKvNCpTBR37GXzYkYACF7C pJgjwH06R3kFj21etmlpvj9CTbUPF963LKfp/9IeB/8aj6Ljp0Wup3C+YRHGNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WHP7H5mkjzSZD; Sun, 7 Jul 2024 23:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467NlNiA002103; Sun, 7 Jul 2024 23:47:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467NlNHW002100; Sun, 7 Jul 2024 23:47:23 GMT (envelope-from git) Date: Sun, 7 Jul 2024 23:47:23 GMT Message-Id: <202407072347.467NlNHW002100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 39733922edc4 - main - rtld: actually resolve memcpy plt List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39733922edc43001e8750307704daa835a14b5ac Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=39733922edc43001e8750307704daa835a14b5ac commit 39733922edc43001e8750307704daa835a14b5ac Author: Ryan Libby AuthorDate: 2024-07-07 23:46:49 +0000 Commit: Ryan Libby CommitDate: 2024-07-07 23:46:49 +0000 rtld: actually resolve memcpy plt The call to memcpy() meant to cause plt resolution in _thr_rtld_init() was getting optimized by the compiler. Tell the compiler not to use its builtins in thr_rtld.c. We could avoid just the memcpy builtin but disabling all will be more robust against future changes. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45891 --- lib/libthr/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile index 85c028f521a1..d3c69a7dc8b7 100644 --- a/lib/libthr/Makefile +++ b/lib/libthr/Makefile @@ -32,6 +32,10 @@ CFLAGS+=-I${SRCTOP}/lib/libthread_db CFLAGS.thr_stack.c+= -Wno-cast-align CFLAGS.rtld_malloc.c+= -Wno-cast-align +# Disable compiler builtins so that the compiler does not optimize away rtld's +# attempts to force early PLT resolution for certain functions that may be +# replaced by builtins. +CFLAGS.thr_rtld.c+= -fno-builtin CFLAGS.thr_symbols.c+= -Wno-missing-variable-declarations .if ${MK_ASAN} != "no" # False-positive ASAN error claiming the local "struct sigaction act;" is