1
0
mirror of https://github.com/golang/go synced 2024-11-19 04:44:41 -07:00

cmd/ld: put .bss from external objects into real .bss section

Fixes #9359.

Change-Id: Iba62935b5a14de23d914f433a09a40417d7e88ed
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/1889
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Shenghou Ma 2014-12-21 02:48:01 -05:00 committed by Minux Ma
parent ce9a4afa6f
commit 1c0c611fc2

View File

@ -545,7 +545,10 @@ ldelf(Biobuf *f, char *pkg, int64 len, char *pn)
s->type = SRODATA;
break;
case ElfSectFlagAlloc + ElfSectFlagWrite:
s->type = SNOPTRDATA;
if(sect->type == ElfSectNobits)
s->type = SNOPTRBSS;
else
s->type = SNOPTRDATA;
break;
case ElfSectFlagAlloc + ElfSectFlagExec:
s->type = STEXT;