mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: delay calculating pe file parameters after Linkmode is set
For #10776. Change-Id: Id64a7e35c7cdcd9be16cbe3358402fa379090e36 Reviewed-on: https://go-review.googlesource.com/36975 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
e31144f128
commit
0ad247c6f0
4 changed files with 23 additions and 24 deletions
|
|
@ -430,6 +430,11 @@ func (ctxt *Link) loadlib() {
|
|||
// We now have enough information to determine the link mode.
|
||||
determineLinkMode(ctxt)
|
||||
|
||||
// Recalculate pe parameters now that we have Linkmode set.
|
||||
if Headtype == obj.Hwindows || Headtype == obj.Hwindowsgui {
|
||||
Peinit(ctxt)
|
||||
}
|
||||
|
||||
if Linkmode == LinkExternal && SysArch.Family == sys.PPC64 {
|
||||
toc := ctxt.Syms.Lookup(".TOC.", 0)
|
||||
toc.Type = obj.SDYNIMPORT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue