]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.4] cmd/ld: put .bss from external objects into real .bss section
authorShenghou Ma <minux@golang.org>
Sun, 21 Dec 2014 07:48:01 +0000 (02:48 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 14 Jan 2015 05:42:14 +0000 (05:42 +0000)
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>
(cherry picked from commit 1c0c611fc2a7e1ce7eb39626ca7b120b62aac557)
Reviewed-on: https://go-review.googlesource.com/2802
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/cmd/ld/ldelf.c

index b5d0819493f2a5ffcc89e6bfc2fcffff6aa8c81f..dd5fa0d2a83941d4b30c4052e0c053e233d963f1 100644 (file)
@@ -539,7 +539,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;