Re: [PATCH 2/2] Exclude debuginfo files from "outside of ELF segments" warning

Tom Tromey
2020-11-12T21:45:23Z

>>>>> "Keith" == Keith Seitz via Gdb-patches <gdb-patches@sourceware.org> writes:

Keith> The short of it is, the ELF program headers for debuginfo files are
Keith> not suited to this particular use case. Consequently, the warning
Keith> generated above really is useless and should be ignored.

Keith> + /* Exclude debuginfo files from this warning, too, since those
Keith> + are often not strictly compliant with the standard. See, e.g.,
Keith> + ld/24717 for more discussion. */
Keith> + if (!is_debuginfo_file (abfd)
Keith> + && bfd_section_size (sect) > 0 && j == num_segments

I didn't know about is_debuginfo_file, so I took a quick look, and it
says:

/* Determine if a bfd is a debuginfo file. Unfortunately there
is no defined method for detecting such files, so we have to
use heuristics instead. */

I wonder if gdb should just use its own idea here, though -- like if the
objfile has a backlink, it is a separate debug file.

I'm ok with this patch though.

thanks,
Tom