mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/6l: call runtime.addmoduledata from .init_array
Change-Id: I09e84161d106960a69972f5fc845a1e40c28e58f Reviewed-on: https://go-review.googlesource.com/8331 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
725cd2ea72
commit
f616af23e0
6 changed files with 83 additions and 3 deletions
|
|
@ -1331,10 +1331,15 @@ func dodata() {
|
|||
|
||||
sect.Length = uint64(datsize) - sect.Vaddr
|
||||
|
||||
hasinitarr := Linkshared
|
||||
|
||||
/* shared library initializer */
|
||||
switch Buildmode {
|
||||
case BuildmodeCArchive, BuildmodeCShared, BuildmodeShared:
|
||||
// TODO(mwhudson): switch on Linkshared
|
||||
hasinitarr = true
|
||||
}
|
||||
|
||||
if hasinitarr {
|
||||
sect := addsection(&Segdata, ".init_array", 06)
|
||||
sect.Align = maxalign(s, SINITARR)
|
||||
datsize = Rnd(datsize, int64(sect.Align))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue