aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/6l
diff options
context:
space:
mode:
authorMichael Hudson-Doyle <michael.hudson@canonical.com>2015-05-05 14:17:07 +1200
committerIan Lance Taylor <iant@golang.org>2015-05-05 22:32:23 +0000
commitde6d5b080120074747baddd239869e2cb1fbe55d (patch)
tree83eec17c194159cfc3f9b2c6f26c6a4229a0a915 /src/cmd/6l
parenta1858e9cf0296841452dd8dfa04b714601a9c339 (diff)
downloadgo-de6d5b080120074747baddd239869e2cb1fbe55d.tar.xz
cmd/internal/ld: reserve space for package list note when -buildmode=shared
This makes the intermediate object file a little bigger but it doesn't waste any space in the final shared library. Fixes #10691 Change-Id: Ic51a571d60291f1ac2dad1b50dba4679643168ae Reviewed-on: https://go-review.googlesource.com/9710 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/6l')
-rw-r--r--src/cmd/6l/obj.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/6l/obj.go b/src/cmd/6l/obj.go
index ba3580ef5f..9e6dc60e2d 100644
--- a/src/cmd/6l/obj.go
+++ b/src/cmd/6l/obj.go
@@ -169,6 +169,14 @@ func archinit() {
ld.Elfinit()
ld.HEADR = ld.ELFRESERVE
+ if ld.Buildmode == ld.BuildmodeShared {
+ // When building a shared library we write a package list
+ // note that can get quite large. The external linker will
+ // re-layout all the sections anyway, so making this larger
+ // just wastes a little space in the intermediate object
+ // file, not the final shared library.
+ ld.HEADR *= 3
+ }
if ld.INITTEXT == -1 {
ld.INITTEXT = (1 << 22) + int64(ld.HEADR)
}