mirror of
https://github.com/golang/go
synced 2024-11-20 10:14:43 -07:00
cmd/link: remove windows-specific kludges from Adddynrel
Adddynrel does nothing on windows. We can make code don't call Adddynrel on windows in the first place. Change-Id: I376cc36d44a5df18bda13be57e3916ca3062f181 Reviewed-on: https://go-review.googlesource.com/62611 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
This commit is contained in:
parent
8435a746f5
commit
410b73728f
@ -239,16 +239,11 @@ func adddynrel(ctxt *ld.Link, s *ld.Symbol, r *ld.Reloc) bool {
|
|||||||
// nothing to do, the relocation will be laid out in reloc
|
// nothing to do, the relocation will be laid out in reloc
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if ld.Headtype == objabi.Hwindows {
|
|
||||||
// nothing to do, the relocation will be laid out in pereloc1
|
|
||||||
return true
|
|
||||||
} else {
|
|
||||||
// for both ELF and Mach-O
|
// for both ELF and Mach-O
|
||||||
addpltsym(ctxt, targ)
|
addpltsym(ctxt, targ)
|
||||||
r.Sym = ctxt.Syms.Lookup(".plt", 0)
|
r.Sym = ctxt.Syms.Lookup(".plt", 0)
|
||||||
r.Add = int64(targ.Plt)
|
r.Add = int64(targ.Plt)
|
||||||
return true
|
return true
|
||||||
}
|
|
||||||
|
|
||||||
case objabi.R_ADDR:
|
case objabi.R_ADDR:
|
||||||
if s.Type == ld.STEXT && ld.Iself {
|
if s.Type == ld.STEXT && ld.Iself {
|
||||||
@ -359,11 +354,6 @@ func adddynrel(ctxt *ld.Link, s *ld.Symbol, r *ld.Reloc) bool {
|
|||||||
r.Type = 256 // ignore during relocsym
|
r.Type = 256 // ignore during relocsym
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if ld.Headtype == objabi.Hwindows {
|
|
||||||
// nothing to do, the relocation will be laid out in pereloc1
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
@ -803,8 +803,10 @@ func windynrelocsym(ctxt *Link, s *Symbol) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func dynrelocsym(ctxt *Link, s *Symbol) {
|
func dynrelocsym(ctxt *Link, s *Symbol) {
|
||||||
if Headtype == objabi.Hwindows && Linkmode != LinkExternal {
|
if Headtype == objabi.Hwindows {
|
||||||
|
if Linkmode == LinkInternal {
|
||||||
windynrelocsym(ctxt, s)
|
windynrelocsym(ctxt, s)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,11 +335,6 @@ func adddynrel(ctxt *ld.Link, s *ld.Symbol, r *ld.Reloc) bool {
|
|||||||
r.Type = 256 // ignore during relocsym
|
r.Type = 256 // ignore during relocsym
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if ld.Headtype == objabi.Hwindows && s.Size == int64(ld.SysArch.PtrSize) {
|
|
||||||
// nothing to do, the relocation will be laid out in pereloc1
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user