• Ali Rizvi-Santiago's avatar
    debug/pe: parse the import directory correctly · e9137299
    Ali Rizvi-Santiago authored
    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: 's avatarAlex Brainman <alex.brainman@gmail.com>
    e9137299
Name
Last commit
Last update
..
testdata Loading commit data...
file.go Loading commit data...
file_cgo_test.go Loading commit data...
file_test.go Loading commit data...
pe.go Loading commit data...
section.go Loading commit data...
string.go Loading commit data...
symbol.go Loading commit data...