From nobody Thu Feb 29 00:26:14 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 4TlX862jpSz5ChxP; Thu, 29 Feb 2024 00:26:14 +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 4TlX862G0Wz54Ss; Thu, 29 Feb 2024 00:26:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709166374; 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=wJ7LpQrs3dab8tjAB4T+Hx6cvOoKAISdpjgwbmfkZ4U=; b=LjzKxl0S6nwFZ6i3NsM6VEjPtmZSm3Mu9wQqVBpmpsk0CifXTitlJchncXXV5Y7gMd24/h 0iKBqZwyROo4aP9VO0hRL6taqN7o4grk8HaCjNLzQ+oyvRlp9hpknQ68ULMnFle15eN4HP lTq9Azg5Ac1peTUkDRAAsDYh4rcYNxdS8JWec3fGbk6MMk/O41T74f3aIXa81dzr0IL24d s9i4p0w+ydyCWWCWPvfQTsn9F7bDmdq51zF0D+LjGqQRk0uxtAZGk4N5nClbAF3sl8j8wQ O+XzY+9jxv8ulKpAmPXRj6bwX9+3bwYEHNSklRb8clBoQqn4qF2q7KOwQ2LA0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709166374; a=rsa-sha256; cv=none; b=lkaULsI45supG+Umdw1eeJPjHQ/q3TLIJesrr+kvDeSvnu4OwmA0lKSJQWD9zzHRum684j C5rEfDKwYW7+/uW5jqWL0rO0W0YKRGsFxThFr8txHELeJXPWzZvxPEx/WZgGjx0ZcNQ695 KsaEW6ITOYyMMZVRt97FudnGTia9bIGbEa+h6loBgTJad16Ez/WDQ7MAkULMgqI0EuHuul 6co+impaK8Sjl4DU5bwh0OaIxjdzN87AsIjGcikbkJWVs28aOGGODhtCKX6Nv13+7CPId4 TNWOAcSz1Tn3RlBeG5Id4qhRwx9iWlmzhHq46Kl91J/2r/4aZzwNU6uV/oUhlw== 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=1709166374; 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=wJ7LpQrs3dab8tjAB4T+Hx6cvOoKAISdpjgwbmfkZ4U=; b=tN+6QxKmaur53T+rhVlvI7DoXUpnnsncs1qrb5IfyVst5aQxXJ8Uz8TMl+S1I3uYlX4Eyx v3eMxNrsVAgfdnTc8rQGYjI7HKOJcmE4iyrEGtiU1/Hyqr8L1j5Yprd4QUGLnDp8CzmnmH Ka5FH0me0ePxRbopaF/i5rRaIgYOk5E6PSlNnLaJZbCc7qh5NOY6cKBa+1Qfd9X5+Fr6cs WRKpmhRd9QkuSfxJNjWjKd+/QkKjN0Ogss5T2iVqziEjhzbyInOYhC5c/Sjvo/nX+TgG8G 5mrIIYlu42P0YgxtBPXZSE0iuSFM0YTb0rSHHjSSgvuvnknN53NPA7JIJzwHTw== 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 4TlX861sFmzK61; Thu, 29 Feb 2024 00:26:14 +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 41T0QEdu096726; Thu, 29 Feb 2024 00:26:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41T0QEin096723; Thu, 29 Feb 2024 00:26:14 GMT (envelope-from git) Date: Thu, 29 Feb 2024 00:26:14 GMT Message-Id: <202402290026.41T0QEin096723@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: 9ef04f1abe5f - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 9ef04f1abe5fa1f429509b2287bee2ba715fa12b Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9ef04f1abe5fa1f429509b2287bee2ba715fa12b commit 9ef04f1abe5fa1f429509b2287bee2ba715fa12b Author: Konstantin Belousov AuthorDate: 2024-02-13 00:48:42 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-29 00:24:43 +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 218e984bdd88..27958ce00398 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -4724,6 +4724,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 @@ -4736,9 +4750,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 @@ -4753,11 +4766,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; @@ -4765,11 +4775,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;