[PATCH v3 1/2] [symtab/27831] Fix OBJF_MAINLINE assert
Tom Tromey
tom@tromey.com
Mon Aug 14 16:00:14 GMT 2023
>>>>> "Kevin" == Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org> writes:
Kevin> This commit fixes a bug mentioned by Florian Weimer during the
Kevin> libpthread/ld.so load order discussion from 2021. Florian provided
Kevin> instructions for reproducing the bug here:
Thanks for the patch.
I think this looks good but I had one possible concern.
Kevin> diff --git a/gdb/elfread.c b/gdb/elfread.c
Kevin> index 349a8b75bcc..dbe5951c802 100644
...
Kevin> - result->maybe_copied = 1;
Kevin> +bool
Kevin> +minimal_symbol::maybe_copied (objfile *objfile) const
Kevin> +{
Kevin> + return ((objfile->flags & OBJF_MAINLINE) == 0
Kevin> + && (m_type == mst_data || m_type == mst_bss));
The old approach was specific to ELF, while the new approach will be
used by any object format.
I am not sure if other object formats even have copy relocs. Do they?
If so then this seems fine. If not, then it seems like it could result
in an incorrect evaluation in some scenario.
Tom
More information about the Gdb-patches
mailing list