From: Simon Marchi <simark@simark.ca>
To: Nick Clifton <nickc@redhat.com>,
Alexander Richardson <Alexander.Richardson@cl.cam.ac.uk>
Cc: Binutils <binutils@sourceware.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH] GDB: Fix detection of ELF support when configuring with -Werror
Date: Fri, 13 Nov 2020 08:46:43 -0500 [thread overview]
Message-ID: <ddae31ca-6358-c77d-819b-2c7cdd6a51ff@simark.ca> (raw)
In-Reply-To: <76418730-3d48-b0f1-b5cc-5626d3c2feae@redhat.com>
On 2020-11-13 7:09 a.m., Nick Clifton wrote:
> Hi Simon,
>
>>> that's what I originally planned, but it seems like elf-bfd.h (and the
>>> headers it includes) don't include any system headers. Since I'm not
>>> familiar with any of this code I assumed this was intentional.
>>>
>>> Alex
>>>
>>
>> Hi binutils@,
>>
>> Could you check the discussion above? Is there a reason elf-bfd.h
>> doesn't include the header file it needs to use the functions it uses?
>
> Essentially this is because elf-bfd.h is internal to the binutils
> sources, and not expected to be used elsewhere. So any code that
> includes it is also expected to include the sysdep.h header which
> does then include the needed system headers.
>
> The idea is that all of the configuration time decisions about which
> system headers to include are confined to one file - sysdep.h - rather
> than having to be copied into all header files.
>
> Cheers
> Nick
>
>
Ah ok I remember this, we started discussing this in:
https://sourceware.org/pipermail/gdb-patches/2020-September/172041.html
In an ideal world, GDB would stop using BFD's internal functions. But
for this, BFD would need to expose some ELF-specific bits, such as
program headers. I don't know if this is against BFD's design
principles to abstract things across various executable formats.
I think Alexander's patch is fine, I don't think the complexity of the
patch linked above is necessary. Are there even any systems today that
GDB supports for which strncmp isn't found in string.h?
Alexander, may I ask what particular configuration you are using? It
would be good to document it in the commit log.
Simon
next prev parent reply other threads:[~2020-11-13 13:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-11 9:20 Alex Richardson via Gdb-patches
2020-11-11 20:48 ` Simon Marchi
2020-11-12 9:25 ` Alexander Richardson via Gdb-patches
2020-11-12 14:23 ` Tom Tromey
2020-11-12 14:25 ` Simon Marchi
2020-11-13 12:09 ` Nick Clifton via Gdb-patches
2020-11-13 13:46 ` Simon Marchi [this message]
2020-11-20 1:12 ` Alexander Richardson via Gdb-patches
2020-11-20 15:54 ` Tom Tromey
2020-11-28 16:50 ` Simon Marchi
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=ddae31ca-6358-c77d-819b-2c7cdd6a51ff@simark.ca \
--to=simark@simark.ca \
--cc=Alexander.Richardson@cl.cam.ac.uk \
--cc=binutils@sourceware.org \
--cc=gdb-patches@sourceware.org \
--cc=nickc@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