From 1ac7a6970198b2448b1165d5e0d651ced4bf73d7 Mon Sep 17 00:00:00 2001 From: Wei Guangjing Date: Wed, 10 Aug 2011 11:09:06 +1000 Subject: [PATCH] ld: add one empty symbol into pe to make dumpbin works. Fixes #2139. R=golang-dev, alex.brainman CC=golang-dev https://golang.org/cl/4838056 --- src/cmd/ld/pe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cmd/ld/pe.c b/src/cmd/ld/pe.c index 2bf9aa468e1..334c9959fa0 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