Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Guinevere Larsen <guinevere@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v3] gdb, configure: Add disable-formats option for configure
Date: Fri, 07 Mar 2025 14:09:59 +0200	[thread overview]
Message-ID: <867c51kpns.fsf@gnu.org> (raw)
In-Reply-To: <20250307115821.1507435-1-guinevere@redhat.com> (message from Guinevere Larsen on Fri, 7 Mar 2025 08:58:21 -0300)

> From: Guinevere Larsen <guinevere@redhat.com>
> Cc: Guinevere Larsen <guinevere@redhat.com>
> 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.

  reply	other threads:[~2025-03-07 12:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07 11:58 Guinevere Larsen
2025-03-07 12:09 ` Eli Zaretskii [this message]
2025-03-07 12:49   ` Guinevere Larsen
2025-03-07 13:03     ` Eli Zaretskii
2025-03-27 20:21 ` [PING][PATCH " Guinevere Larsen
2025-04-03 17:35 ` [PATCH " Tom Tromey
2025-04-07 17:48   ` Guinevere Larsen
2025-04-07 19:23     ` Tom Tromey
2025-04-08 13:47 ` [PATCH v4] " Guinevere Larsen
2025-04-08 14:06   ` Andreas Schwab
2025-04-08 14:24     ` Guinevere Larsen
2025-04-08 14:44       ` Andreas Schwab
2025-05-26 17:11   ` [PATCH v5 1/1] " Guinevere Larsen
2025-07-07 20:16     ` [PATCH v6] " Guinevere Larsen
2025-07-31 18:42       ` [PING][PATCH " Guinevere Larsen
2025-08-05 16:03       ` [PATCH " Simon Marchi
2025-08-05 19:06         ` Eli Zaretskii
2025-08-05 19:36           ` Simon Marchi
2025-08-05 20:07         ` Guinevere Larsen
2025-08-06 13:53           ` Guinevere Larsen
2025-08-06 14:17       ` [PATCH v7 1/1] gdb, configure: Add enable-binary-file-format " Guinevere Larsen
2025-08-14 15:39         ` Tom Tromey
2025-08-14 16:23           ` Guinevere Larsen
2025-05-27 11:32 ` [PATCH v3] gdb, configure: Add disable-formats " Pedro Alves
2025-05-27 16:26   ` Guinevere Larsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=867c51kpns.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox