]> Cypherpunks repositories - gostls13.git/commit
debug/pe: truncate pe sections to their size in memory
authorAlex Brainman <alex.brainman@gmail.com>
Mon, 6 Jul 2015 05:52:33 +0000 (15:52 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Fri, 10 Jul 2015 03:33:38 +0000 (03:33 +0000)
commit315e5c99d868bffad5ac75871e486d6f3a625f23
treecd63400692831a9d32062beeff1a48d1619715b1
parentb615ad8fd57f9394db14e403d12061c369379c52
debug/pe: truncate pe sections to their size in memory

Section.Data returns disk section data, but those are rounded up to
some predefined value. Processing these as is confuses dwarf parser
because of garbage at the end. Truncate Section.Data as per memory
section description.

Sometimes dwarf sections have memory section size of 0
(for pe object files). Keep those to their disk size.

Fixes #11608

Change-Id: I8de0a2271201a24aa9ac8dac44f1e9c8a9285183
Reviewed-on: https://go-review.googlesource.com/11950
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/debug/pe/file.go
src/debug/pe/file_test.go