summaryrefslogtreecommitdiff
path: root/src/cmd/ld/pe.c
diff options
context:
space:
mode:
authorWei Guangjing <vcc.163@gmail.com>2011-08-10 11:09:06 +1000
committerWei Guangjing <vcc.163@gmail.com>2011-08-10 11:09:06 +1000
commit4189888bad3a437bda2696cda885812471667166 (patch)
tree8631f7b0839d370cbbdd2239cb1fccd0e72b46b6 /src/cmd/ld/pe.c
parent3e5ce3dbaa4673429f725c9f9e812c84516774cb (diff)
downloadgo-4189888bad3a437bda2696cda885812471667166.tar.gz
ld: add one empty symbol into pe to make dumpbin works.
Fixes issue 2139. R=golang-dev, alex.brainman CC=golang-dev http://codereview.appspot.com/4838056 Committer: Alex Brainman <alex.brainman@gmail.com>
Diffstat (limited to 'src/cmd/ld/pe.c')
-rw-r--r--src/cmd/ld/pe.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmd/ld/pe.c b/src/cmd/ld/pe.c
index 2bf9aa468..334c9959f 100644
--- a/src/cmd/ld/pe.c
+++ b/src/cmd/ld/pe.c
@@ -453,13 +453,14 @@ addsymtable(void)
if(nextsymoff == 0)
return;
- size = nextsymoff + 4;
+ size = nextsymoff + 4 + 18;
h = addpesection(".symtab", size, size);
h->Characteristics = IMAGE_SCN_MEM_READ|
IMAGE_SCN_MEM_DISCARDABLE;
chksectoff(h, cpos());
fh.PointerToSymbolTable = cpos();
- fh.NumberOfSymbols = 0;
+ fh.NumberOfSymbols = 1;
+ strnput("", 18); // one empty symbol
// put symbol string table
lputl(size);
for (i=0; i<nextsymoff; i++)