]> Cypherpunks repositories - gostls13.git/commit
debug/pe: parse the import directory correctly
authorAli Rizvi-Santiago <arizvisa@gmail.com>
Fri, 18 May 2018 18:48:44 +0000 (18:48 +0000)
committerAlex Brainman <alex.brainman@gmail.com>
Sat, 19 May 2018 06:06:37 +0000 (06:06 +0000)
commite9137299bf74e1bcac358b569f86aef73c7c2ea6
tree555ca6762d078514a767aba94064cb54927c3ae7
parent529362e1e2d68c1740ee71a7d5ece3f2c5190791
debug/pe: parse the import directory correctly

This parses the import table properly which allows for debug/pe
to extract import symbols from pecoffs linked with an import
table in a section named something other than ".idata"

The section names in a pecoff object aren't guaranteed to actually
mean anything, so hardcoding a search for the ".idata" section
is not guaranteed to find the import table in all shared libraries.
This resulted in debug/pe being unable to read import symbols
from some libraries.

The proper way to locate the import table is to validate the
number of data directory entries, locate the import entry, and
then use the va to identify the section containing the import
table. This patch does exactly this.

Fixes #16103.

Change-Id: I3ab6de7f896a0c56bb86c3863e504e8dd4c8faf3
GitHub-Last-Rev: ce8077cb154f18ada7a86e152ab03de813937816
GitHub-Pull-Request: golang/go#25193
Reviewed-on: https://go-review.googlesource.com/110555
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
src/debug/pe/file.go
src/debug/pe/file_test.go
src/debug/pe/pe.go