From nobody Thu Aug 7 00:10:25 2025 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 4by6xY4pyHz64PWC; Thu, 07 Aug 2025 00:10:25 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4by6xY338nz3p9v; Thu, 07 Aug 2025 00:10:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754525425; 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=42Bg9pSu0XZoiRJ5/9sZMne8aVwsX43pMbdoDZE5+Sw=; b=GX5yaJtOVpj8vxC3NCAj+qpggDnIdaaTXh0IHQJAi8W56g8t+STIJx064KCnwexP0n5MlE mJEOUJKhGJunjylX1Ry3JOYU8GyWE4+ihA6CZ26U3X1CPgGk1vfRs45+KB9SBQGRZx56Q+ KA0HrUrwHIrZiE5aa9AnzZT0Mr/jWxnHeH10xRcyFkgQm3wnDwkq6iJBnWcJU78eoTfNDN RDdsJ/TWp5iYZyfQ8mKNgqOctJDRWYitWkzwc3QfKeQsQ1L+XK37qBIMI9p66OJBEa+mcI sKQo5BUdqlOy56KKrbnGQgcxjCIomw9lpRdN2HfZpTqI5rovdhTZQ/HGHto7cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754525425; 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=42Bg9pSu0XZoiRJ5/9sZMne8aVwsX43pMbdoDZE5+Sw=; b=wP1gGrcFNH46S7MPdreg2VohPoDrJwgjcB74YaG+0VJc3YOpVQdK0GAw5HZwrtbLIKe7jL xypExXex6dj1NHzQxoaPMe4ivXlCwfidI9STfJBRaDdUpeX7tnQHfuuIqVOEAnBbNyZJvD WVXnpUqULYz5AYrE2lhAxb3Wa/TsY7CSS3LZxRGzB39ME00lcTC13gh1aYjiv1h8hf4aCY c0mm3zGgMOu5bivf8M9sDawTEVR4ldR9CC/blQyyuPJoXMnXN5SsZicFr7IGw2JliaEHD7 rGQ6uN+bVkAoynzFCeD6KMAPcvtvUkHbAd2pedVWt2a0pndJ2z56w20+Ybs0Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754525425; a=rsa-sha256; cv=none; b=VYwDfsAY7cAG5y0hf6ONHYuu6k9KUH3vMQwvy/SY9FDK2wLUIFjY8BB2OfpdH7/AIVr/9j wiLxvlO1NXMe2CyjlTFXcdMvhUhfc7kvV+xzc/xstW3cAgf9uUUuQbkiuS57RTwCofqTvf ZmGZN7c9dLq4bbnHYIyqVp9NkbSH8pG/gNWXkmtLO7wcIERTLeO1BK3YDZLYkKFLiaYhKd GixgfnfVkdst5e+HvOZ5QVDPPV+uv1/yA0RBwDsXV3EGxL8HYtnS8MQaxqzj34PmgsLJ9Y oZzdxdgR7qu6wWABQZ0LOMQj97d91opKmr0nj7x1d38BzrXeS+HbzIS8gr//vQ== 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 4by6xY20NszjQ3; Thu, 07 Aug 2025 00:10:25 +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 5770AP60023774; Thu, 7 Aug 2025 00:10:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5770APxM023771; Thu, 7 Aug 2025 00:10:25 GMT (envelope-from git) Date: Thu, 7 Aug 2025 00:10:25 GMT Message-Id: <202508070010.5770APxM023771@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 650bcf5b6be2 - main - rtld-elf: Don't include duplicate semicolon in Obj_Entry 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 650bcf5b6be222184d6258c303bdce7434d2f041 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=650bcf5b6be222184d6258c303bdce7434d2f041 commit 650bcf5b6be222184d6258c303bdce7434d2f041 Author: Jessica Clarke AuthorDate: 2025-08-07 00:10:18 +0000 Commit: Jessica Clarke CommitDate: 2025-08-07 00:10:18 +0000 rtld-elf: Don't include duplicate semicolon in Obj_Entry MD_OBJ_ENTRY is a list of members, possibly empty, to include in Obj_Entry. By including the semicolon here, in the case that it's empty, we end up with a duplicate semicolon. In the case that it's not empty, whether there's a duplicate depends on each architecture's definition, but they all in fact put a semicolon after every member, so there is also a duplicate semicolon there. This is invalid C syntax, although both GCC and Clang accept it, treating it only as a pedantic warning, but there is no need for us to rely on that, and downstream it masked a missing semicolon for an added field, but only on architectures where MD_OBJ_ENTRY is empty, leading to conditional compilation failure for something that should have been detected as an unconditional error. Note that PCPU_MD_FIELDS, which this is based on, follows a different style. There, every architecture defines at least one member, and there is a semicolon after PCPU_MD_FIELDS in sys/sys/pcpu.h, but every architecture makes sure to not put a semicolon after the final member in its definition of the macro. This is not a pattern we can adhere to here though given not all architectures add members. Fixes: 06db20ffeca9 ("rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_Entry") --- libexec/rtld-elf/rtld.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 46473b92a637..d4829b17cebb 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -268,7 +268,7 @@ typedef struct Struct_Obj_Entry { bool unholdfree : 1; /* unmap upon last unhold */ bool doomed : 1; /* Object cannot be referenced */ - MD_OBJ_ENTRY; + MD_OBJ_ENTRY struct link_map linkmap; /* For GDB and dlinfo() */ Objlist dldags; /* Object belongs to these dlopened DAGs (%) */