mirror of
https://github.com/golang/go
synced 2024-11-21 21:54:40 -07:00
8l: do not emit empty dwarf pe sections
This change will allow to generate valid executable, even if rsc disables dwarf generation, as it happend at revision 9a64273f9d68. R=rsc CC=golang-dev, lvd, vcc https://golang.org/cl/4425066
This commit is contained in:
parent
1038e7c853
commit
2d99974ec5
@ -2567,12 +2567,8 @@ dwarfaddpeheaders(void)
|
||||
newPEDWARFSection(".debug_line", linesize);
|
||||
newPEDWARFSection(".debug_frame", framesize);
|
||||
newPEDWARFSection(".debug_info", infosize);
|
||||
if (pubnamessize > 0)
|
||||
newPEDWARFSection(".debug_pubnames", pubnamessize);
|
||||
if (pubtypessize > 0)
|
||||
newPEDWARFSection(".debug_pubtypes", pubtypessize);
|
||||
if (arangessize > 0)
|
||||
newPEDWARFSection(".debug_aranges", arangessize);
|
||||
if (gdbscriptsize > 0)
|
||||
newPEDWARFSection(".debug_gdb_scripts", gdbscriptsize);
|
||||
newPEDWARFSection(".debug_pubnames", pubnamessize);
|
||||
newPEDWARFSection(".debug_pubtypes", pubtypessize);
|
||||
newPEDWARFSection(".debug_aranges", arangessize);
|
||||
newPEDWARFSection(".debug_gdb_scripts", gdbscriptsize);
|
||||
}
|
||||
|
@ -415,6 +415,9 @@ newPEDWARFSection(char *name, vlong size)
|
||||
IMAGE_SECTION_HEADER *h;
|
||||
char s[8];
|
||||
|
||||
if(size == 0)
|
||||
return nil;
|
||||
|
||||
if(nextsymoff+strlen(name)+1 > sizeof(symnames)) {
|
||||
diag("pe string table is full");
|
||||
errorexit();
|
||||
|
Loading…
Reference in New Issue
Block a user