From nobody Thu Feb 22 01:27:54 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 4TgFrW11zwz5Bm09; Thu, 22 Feb 2024 01:27:55 +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 4TgFrV4np3z4k1g; Thu, 22 Feb 2024 01:27:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708565274; 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=/TbuVI0kNqCLKd0WvNYdzMU7hFGuIevQH3cyXxQib5U=; b=yPw41TaK1zsIntWUYYvNziaEXgaI193VxOYpWKbQUgob7moV7k89zdGI0MsS2wHZ/TO8GC oILDZ4apVHwqip2UbUCo3lV4D1/3FhLCNSofWJDCGOmW0ZRMT8FKM6/bx2PAY/B+fwjsCQ UaPbMSrbN4P8Mx+19deEe9gkjd1Scqf6sj855kJifn9jmwXh8jmsz6cjp56UtXnbQCi5J9 bpdnluUo1O1XdRgBblzNvURy8OEBq7Wur0C7NxsBRp2dccvteHmctt6x1Ev2qv8EbHit0O MVlG1DW5+Y1zQdDaY7Jh73HO/6UH9JnNWUoUChGX5H089pxmdGuLDyBuA78w5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708565274; 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=/TbuVI0kNqCLKd0WvNYdzMU7hFGuIevQH3cyXxQib5U=; b=WqdxgfgZtCWvzOG9Nb0EoFs71318vo2rxBtEYwJlkuJcHz2iRrdJF+vm/BgRTIGMBdC1m4 eCWr+qwYR+PY1CAaihHOvaDKfLbqwHCBm6xJI2//Kr8378R5OJ406PjL5bO4VQfAsr2Mle s5vshcpNvVGhov1yp9UIW449Zm2HkHz6JYb/mFkYJ5Js7eC5bAb2AifKH7yPhonn7ufjgE a+1/6le5uqt/cYwNjo2dviD7ZHhUFKKlinO6fCRlbkl7UZ05V6d01FmZ0/LeEiicXVkGCq gcfN7ddhAaWP7J5v4h5h8kDQ+pUDLZQDB+vY7T9tM9ODujxL+CDsEEK6vTM8SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708565274; a=rsa-sha256; cv=none; b=D/s7UM81IdWq+ZzWMgqKlcCV7VOUmtwwaRW1pOqDE+lWzygZvJob8xbwE3oIeWfPO3I5V4 yTT2rjIC61CFee1+DtrFiCkxulvrL2NF7HgPDq9qFOJ0rwg/dYYOWkT81UzJ1kEmXb3Tzd fbsCgztGP/VwzcxT6Ky6bggwhAZ09BpOOxn6QcX2zHCr+0NNMflwVRuA9CMrqzJ6kuxPwe JXDHXiu7b/t+h+kM70DLx5/yact8U5JLSMgp+z4H8shQsQQhcEE+kE6ZF0NIA8/pme6xY5 KWWENjTUmk2In1x8SyjjkxZSlR9HvOOT9QTpYl093LNcYRypXva16WmBUZ7yEA== 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 4TgFrV3sMhz1QrN; Thu, 22 Feb 2024 01:27:54 +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 41M1RsFb092299; Thu, 22 Feb 2024 01:27:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41M1RsBj092296; Thu, 22 Feb 2024 01:27:54 GMT (envelope-from git) Date: Thu, 22 Feb 2024 01:27:54 GMT Message-Id: <202402220127.41M1RsBj092296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 452c5e9995ab - main - fdlopen(3): do not create a new object mapping if already loaded 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/main X-Git-Reftype: branch X-Git-Commit: 452c5e9995ab4cd6c7ea230cffe0c53bfa65c1ab Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=452c5e9995ab4cd6c7ea230cffe0c53bfa65c1ab commit 452c5e9995ab4cd6c7ea230cffe0c53bfa65c1ab Author: Konstantin Belousov AuthorDate: 2024-02-22 01:18:06 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-22 01:27:09 +0000 fdlopen(3): do not create a new object mapping if already loaded This is expected behavior for both dlopen(3) and fdlopen(3). PR: 277169 Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44019 --- libexec/rtld-elf/rtld.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 7d6b8ae52703..30ed48b5c615 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -2752,8 +2752,9 @@ load_object(const char *name, int fd_u, const Obj_Entry *refobj, int flags) if (obj->ino == sb.st_ino && obj->dev == sb.st_dev) break; } - if (obj != NULL && name != NULL) { - object_add_name(obj, name); + if (obj != NULL) { + if (name != NULL) + object_add_name(obj, name); free(path); close(fd); return (obj);