diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2020-04-16 15:46:03 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2020-04-16 15:46:36 -0400 |
commit | 00ac85d3751b763155adb4e9d15dd134399b4e77 (patch) | |
tree | 70878801a6acb5757be71fd35df4aa770394471f /gdb/ChangeLog | |
parent | 8e4979ac1ea78147ecbcbf81af5e946873dda079 (diff) | |
download | gdb-00ac85d3751b763155adb4e9d15dd134399b4e77.zip gdb-00ac85d3751b763155adb4e9d15dd134399b4e77.tar.gz gdb-00ac85d3751b763155adb4e9d15dd134399b4e77.tar.bz2 |
gdb: is_linked_with_cygwin_dll: handle import table not at beginning of .idata section
When loading the file C:\Windows\SysWOW64\msvcrt.dll, taken from a
Windows 10 system, into GDB, we get the following warning:
warning: Failed to parse .idata section: name's virtual address (0x0) is outside .idata section's range [0xb82b8, 0xb97f0[.
This uncovers an issue with how we parse the import table, part of the
.idata section. Right now, we assume that the import table is located
at the beginning of the section. That was the case in everything I had
tried so far, but this file is an example where that's not true.
We need to compute the offset of the import table within the .idata
section, and start there, instead of at the beginning of the .idata
section. Using the file mentioned above, this is the values we have to
work with:
A) bfd_section_vma (idata_section) 101b8000
B) Import table's virtual address b82b8
C) Image base 10100000
The virtual address that BFD returns us for the section has the image
base applied, so we need to subtract it first. The offset of the table
in the section is therefore:
B - (A - C)
This patch implements that.
gdb/ChangeLog:
* windows-tdep.c (is_linked_with_cygwin_dll): Consider case where
import table is not at beginning of .idata section.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6c280e3..ebba52f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-04-16 Simon Marchi <simon.marchi@polymtl.ca> + + * windows-tdep.c (is_linked_with_cygwin_dll): Consider case where + import table is not at beginning of .idata section. + 2020-04-16 Pedro Alves <palves@redhat.com> * inferior.c (delete_inferior): Use delete operator directly |