From nobody Sun Feb 18 10:09:09 2024 X-Original-To: dev-commits-src-all@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 4Td1bp00gwz5C8sW; Sun, 18 Feb 2024 10:09:10 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Td1bn6hL7z4Cq1; Sun, 18 Feb 2024 10:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708250949; 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=qrJgw5BgBI7Dh2UPWoJGDVMaVnzmmND6hTw7uBNFteo=; b=mYqRg7L+eqzf/I5W1Dxmsw6DW89Y5HaaPxIem9eV81Lz5SmY8O1mRnjBoxVcSab4NOWAxg svhpJwOEYwCt2WSU1dGVBulDdT+oAR3xLIVCXi4BTq1zdgI/SJDvzj0Y/r5HKRj5ntYVo9 oiK3mPMAs+LanSRGGk3zBSA1CrNJkICf9yogmfoxjc3blzvSbe3J/pr+ldVf8LKwnPWwGP oss8b2hY53Ql6h26bSis8+JNXxgCtPVBQK3pib+C7DFexlMlHmRyMB/GscCI+lHnKmMQtn 5fyvd1dwV8u1DBG8Fa6vqa44KiDAwrDaxzoBZ2xJTvBy0v1pCG17mFuISUwiFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708250949; 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=qrJgw5BgBI7Dh2UPWoJGDVMaVnzmmND6hTw7uBNFteo=; b=pgOwniyOXRPEr0Q6T50N/aUBqvlOghCBh67d99b0rZ27+/vUMFjYxvV4PB80CJTl/IQdCQ 6k3FnDCkhkz4yUozFBiJ7eZIPSzBQZm90/wbfgdDvFgjA2XCwzaGr74DYZTBmJa5Zz65P+ phGLS5LuQUUPfSr8AF65XksxDly9zroj/chHhIOG0B0sRV95qlkyObGV14qAklMx0/+jD4 CQrzjPfi3/4GTaqWidyAppINNuGsBiPSJ/53RBX7KyeMg1Yc51muWGEN0X9pDEq020PIF2 wt2yjNFW+VV710I6jWKNmZ0DYPJ05eNtKjqX4X91IWFdOWPXFdjeqoG7BOvzPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708250949; a=rsa-sha256; cv=none; b=jfq39rNxeo5locWB4219R2XilctQtP5TASAcRk97vd27s+LBwQXqNVvk6rO/XC+qCacpbh jXyKN88+UJAb0gTHm4QiVuwpoTouIduQJ10Z5DhRB8jsQCzxtU+1yJ9yQ+rIJDMnxYXSGJ w5rCtZGsCxDVu37gC1Xygh7i1TboAZnWhzr2DNJcYKCqOnW1TfNHg4DyZFrMyvO2BOXPSw k5huqNyTQTtc7l55sfE36FKhHFC04O3TcsESydXSlzOSjIn9UJuVMHkWvDqz+2dTjMT6t6 ZQkt21DiMbd3fcpKRCwwU8b3ZM86xGdqpWVtwdIZVWuwrqtxVjhhTn2X9GIA9w== 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 4Td1bn5RQXzn0B; Sun, 18 Feb 2024 10:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41IA99LP086010; Sun, 18 Feb 2024 10:09:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41IA999B086008; Sun, 18 Feb 2024 10:09:09 GMT (envelope-from git) Date: Sun, 18 Feb 2024 10:09:09 GMT Message-Id: <202402181009.41IA999B086008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c6d4339208b4 - stable/14 - rtld symlook_obj: move common code to check filtees into helper List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c6d4339208b4cade3cfb1642943da91ae31ed6ae Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c6d4339208b4cade3cfb1642943da91ae31ed6ae commit c6d4339208b4cade3cfb1642943da91ae31ed6ae Author: Konstantin Belousov AuthorDate: 2024-02-13 00:48:42 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-18 10:01:46 +0000 rtld symlook_obj: move common code to check filtees into helper (cherry picked from commit 9ea864b54b57f2d0125860fb923f8db52b20eac2) --- libexec/rtld-elf/rtld.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 37c016299a66..380b2696f41c 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -4680,6 +4680,20 @@ symlook_needed(SymLook *req, const Needed_Entry *needed, DoneList *dlp) return (ESRCH); } +static int +symlook_obj_load_filtees(SymLook *req, SymLook *req1, const Obj_Entry *obj, + Needed_Entry *needed) +{ + DoneList donelist; + int flags; + + flags = (req->flags & SYMLOOK_EARLY) != 0 ? RTLD_LO_EARLY : 0; + load_filtees(__DECONST(Obj_Entry *, obj), flags, req->lockstate); + donelist_init(&donelist); + symlook_init_from_req(req1, req); + return (symlook_needed(req1, needed, &donelist)); +} + /* * Search the symbol table of a single shared object for a symbol of * the given name and version, if requested. Returns a pointer to the @@ -4692,9 +4706,8 @@ symlook_needed(SymLook *req, const Needed_Entry *needed, DoneList *dlp) int symlook_obj(SymLook *req, const Obj_Entry *obj) { - DoneList donelist; SymLook req1; - int flags, res, mres; + int res, mres; /* * If there is at least one valid hash at this point, we prefer to @@ -4709,11 +4722,8 @@ symlook_obj(SymLook *req, const Obj_Entry *obj) if (mres == 0) { if (obj->needed_filtees != NULL) { - flags = (req->flags & SYMLOOK_EARLY) ? RTLD_LO_EARLY : 0; - load_filtees(__DECONST(Obj_Entry *, obj), flags, req->lockstate); - donelist_init(&donelist); - symlook_init_from_req(&req1, req); - res = symlook_needed(&req1, obj->needed_filtees, &donelist); + res = symlook_obj_load_filtees(req, &req1, obj, + obj->needed_filtees); if (res == 0) { req->sym_out = req1.sym_out; req->defobj_out = req1.defobj_out; @@ -4721,11 +4731,8 @@ symlook_obj(SymLook *req, const Obj_Entry *obj) return (res); } if (obj->needed_aux_filtees != NULL) { - flags = (req->flags & SYMLOOK_EARLY) ? RTLD_LO_EARLY : 0; - load_filtees(__DECONST(Obj_Entry *, obj), flags, req->lockstate); - donelist_init(&donelist); - symlook_init_from_req(&req1, req); - res = symlook_needed(&req1, obj->needed_aux_filtees, &donelist); + res = symlook_obj_load_filtees(req, &req1, obj, + obj->needed_aux_filtees); if (res == 0) { req->sym_out = req1.sym_out; req->defobj_out = req1.defobj_out;