]> Cypherpunks repositories - gostls13.git/commit
debug/pe: handle files with no string table
authorAlex Brainman <alex.brainman@gmail.com>
Fri, 17 Jun 2016 04:05:35 +0000 (14:05 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Sun, 19 Jun 2016 05:18:09 +0000 (05:18 +0000)
commit691c5c156878799ec15683f10e24d9a924ea7996
tree2fd0e16732ad8ba341fbbfd254fa70dfbfde2865
parentf3d54789f764f0f6dba1d2f12ad01986d66ea31c
debug/pe: handle files with no string table

pecoff.doc (https://goo.gl/ayvckk) in section 5.6 says:

Immediately following the COFF symbol table is the COFF string table.
The position of this table is found by taking the symbol table address
in the COFF header, and adding the number of symbols multiplied by
the size of a symbol.

So it is unclear what to do when symbol table address is 0.
Lets assume executable does not have any string table.

Added new test with executable with no symbol table. The

gcc -s testdata\hello.c -o testdata\gcc-386-mingw-no-symbols-exec.

command was used to generate the executable.

Fixes #16084

Change-Id: Ie74137ac64b15daadd28e1f0315f3b62d1bf2059
Reviewed-on: https://go-review.googlesource.com/24200
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/debug/pe/file_test.go
src/debug/pe/string.go
src/debug/pe/testdata/gcc-386-mingw-no-symbols-exec [new file with mode: 0644]