[PATCH] gdb: make is_linked_with_cygwin_dll handle import table not at beginning of .idata section

Pedro Alves palves@redhat.com
Thu Apr 16 16:27:40 GMT 2020


On 4/16/20 4:45 PM, Simon Marchi via Gdb-patches wrote:
> +  /* The section's virtual address as reported by BFD has the image base applied,
> +     remove it.  */
> +  gdb_assert (idata_section_va >= pe_extra->ImageBase);
> +  idata_section_va -= pe_extra->ImageBase;
> +
> +  /* Assert that the import table is indeed within the .idata section's range.  */
> +  gdb_assert (import_table_va >= idata_section_va);
> +  gdb_assert (import_table_va < (idata_section_va + idata_section_size));

Couldn't these be triggered with malformed files?  I.e., seems like an assertion
is too strong, and we should maybe warn and return false instead.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list