From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Toi2KUXiymc/AAgAWB0awg (envelope-from ) for ; Fri, 07 Mar 2025 07:10:45 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=L7AbBXRg; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 914D51E105; Fri, 7 Mar 2025 07:10:45 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id BCA6F1E08E for ; Fri, 7 Mar 2025 07:10:44 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 06A4B3858C31 for ; Fri, 7 Mar 2025 12:10:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06A4B3858C31 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=L7AbBXRg Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id E6FE13858D1E for ; Fri, 7 Mar 2025 12:10:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E6FE13858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E6FE13858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741349408; cv=none; b=BfiUxXghyO0ejpAsgvu6XGLjpldAhLvuCBoOYfBeZf6NtxFSF+wpL8FHmw5FKAAAsEsfpRSBDGiSFuBHe37Sij3+DrwyF5Ju+hn8moaFqb7UjDUQaFLQgApSnc9LWgHOGalgeyqd192ZEMJSijVgRl/tajEItlStfUBPiT6rOHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741349408; c=relaxed/simple; bh=rK8PC9lVmJEBfNyOHorUTFXDy00YGTd1vDB6/Z1t8Ho=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=jcqGkE1pxHQySKoN4CeC14CeIKlO7MYWCSrO/ai/G5ZHznYVki7qewTHMCbNORhCsYlwhD222H047ftmlQGIL+VxlT2zZCQ4IsvW8iYY08Rk4M7TZj+dJDYchdVsH5ISX24LE+1/zFCqbZy8eEZqvGT1lz1wyFddFr7Hq6jsxnc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E6FE13858D1E Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tqWWk-00040U-QO; Fri, 07 Mar 2025 07:10:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3sNW+golLscyQc5uwvlv2uS0IJvTNTlp9c0MjfKb0GM=; b=L7AbBXRgzfwB msobXHsHJZ/SsnS5ow51m/9jM2YifizFkescuVMdJC4H5by+aNvsC4V51RFwGI9xNA3VV3eUbAtyk Qp8PwVRFxrkYcN1G50GOoRbttmdNlsH8kymNhIHnfWRYl604A/3RIYei0e2FABYQevDpBzv69f4tl Fie3L08eMf3mrpelC4DeWNjlJAOnL23t4WdJ7f/Oa8bcC0ICZpMGSJ5trmaFPuLBRjw3WR7uvdOGn aO5Igr+bltW3OBKd0arJ3BdXGUyoj2PDuWZr138V/xizFCvIuxYbGwG2g8n3OeUvJlkrF59N4mev7 ZorWh2vpajmmfq+xgCCUlA==; Date: Fri, 07 Mar 2025 14:09:59 +0200 Message-Id: <867c51kpns.fsf@gnu.org> From: Eli Zaretskii To: Guinevere Larsen Cc: gdb-patches@sourceware.org In-Reply-To: <20250307115821.1507435-1-guinevere@redhat.com> (message from Guinevere Larsen on Fri, 7 Mar 2025 08:58:21 -0300) Subject: Re: [PATCH v3] gdb, configure: Add disable-formats option for configure References: <20250307115821.1507435-1-guinevere@redhat.com> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org > From: Guinevere Larsen > Cc: Guinevere Larsen > Date: Fri, 7 Mar 2025 08:58:21 -0300 > > GDB has support for many binary file formats, some which might be very > unlikely to be found in some situations (such as the COFF format in > linux). This commit introduces the option for a user to choose which > formats GDB will support at build configuration time. > > This is especially useful to avoid possible security concerns with > readers that aren't expected to be used at all, as they are one of > the simplest vectors for an attacker to try and hit GDB with. This > change can also reduce the size of the final binary, if that is a > concern. > > This commit adds a switch to the configure script allowing a user to > only enable selected file formats, called --enable-binary-file-formats. > The default behavior when the switch is omitted is to compile all file > formats, keeping the original behavior of the script. At the time of > this commit, the valid options for this option are: dbx, coff (which > includes coff-pe), xcoff, mips, elf, macho and all. All is treated > especially, activating all supported readers. > > A few targets may require specific binary file format support, as they > directly call functions defined by the file reader. Specifically, > windows targets require coff support, and rs6000 aix and lynx178 targets > require xcoff support. Considering that those formats are the main - or > only - one available in those targets, I believe it makes sense to > re-enable those readers. If that happens, the script will emit the > following warning: > > FOO is required to support one or more requested targets. Adding it > > Users aren't able to force the disabling of those formats, since GDB > will not compile without those readers. Ideally we'd like to be able > to disable even those formats, in case a user wants to build GDB only > to examine remote files for example, but the current infrastructure > for the file format readers doesn't allow us to do it. > > Mach-O and elf support are also dependent on BFD support being compiled > in. In case one of those was requested and BFD does not support them, > the following error is emitted: > > FOO was requested, but BFD does not support it. > > Finally, this configure switch is also printed by the "show > configuration" command in GDB. > --- > gdb/Makefile.in | 13 +++---- > gdb/NEWS | 11 ++++++ > gdb/README | 24 +++++++++++++ > gdb/config.in | 3 ++ > gdb/configure | 81 +++++++++++++++++++++++++++++++++++++++++--- > gdb/configure.ac | 65 +++++++++++++++++++++++++++++++++-- > gdb/configure.format | 51 ++++++++++++++++++++++++++++ > gdb/configure.tgt | 20 +++++++++-- > gdb/doc/gdb.texinfo | 8 +++++ > gdb/top.c | 5 +++ > 10 files changed, 264 insertions(+), 17 deletions(-) > create mode 100644 gdb/configure.format Thanks, but can you describe the changes sine v2, so I could determine whether I need to review the documentation parts of this? TIA.