Commit 1ac7a697 authored by Wei Guangjing's avatar Wei Guangjing Committed by Alex Brainman

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
parent d24a9785
...@@ -453,13 +453,14 @@ addsymtable(void) ...@@ -453,13 +453,14 @@ addsymtable(void)
if(nextsymoff == 0) if(nextsymoff == 0)
return; return;
size = nextsymoff + 4; size = nextsymoff + 4 + 18;
h = addpesection(".symtab", size, size); h = addpesection(".symtab", size, size);
h->Characteristics = IMAGE_SCN_MEM_READ| h->Characteristics = IMAGE_SCN_MEM_READ|
IMAGE_SCN_MEM_DISCARDABLE; IMAGE_SCN_MEM_DISCARDABLE;
chksectoff(h, cpos()); chksectoff(h, cpos());
fh.PointerToSymbolTable = cpos(); fh.PointerToSymbolTable = cpos();
fh.NumberOfSymbols = 0; fh.NumberOfSymbols = 1;
strnput("", 18); // one empty symbol
// put symbol string table // put symbol string table
lputl(size); lputl(size);
for (i=0; i<nextsymoff; i++) for (i=0; i<nextsymoff; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment