mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: fix PE emitRelocations for >4GB base address
Change-Id: I1dda31bb1efa177159e4e7b4c9c9cc615e2fdc0c Reviewed-on: https://go-review.googlesource.com/c/go/+/312037 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
59ceb985c7
commit
a0248a99a8
1 changed files with 3 additions and 3 deletions
|
|
@ -534,12 +534,12 @@ func (f *peFile) emitRelocations(ctxt *Link) {
|
|||
break
|
||||
}
|
||||
}
|
||||
eaddr := int32(sect.Vaddr + sect.Length)
|
||||
eaddr := int64(sect.Vaddr + sect.Length)
|
||||
for _, s := range syms {
|
||||
if !ldr.AttrReachable(s) {
|
||||
continue
|
||||
}
|
||||
if ldr.SymValue(s) >= int64(eaddr) {
|
||||
if ldr.SymValue(s) >= eaddr {
|
||||
break
|
||||
}
|
||||
// Compute external relocations on the go, and pass to PEreloc1
|
||||
|
|
@ -559,7 +559,7 @@ func (f *peFile) emitRelocations(ctxt *Link) {
|
|||
ctxt.Errorf(s, "reloc %d to non-coff symbol %s (outer=%s) %d", r.Type(), ldr.SymName(r.Sym()), ldr.SymName(rr.Xsym), ldr.SymType(r.Sym()))
|
||||
}
|
||||
if !thearch.PEreloc1(ctxt.Arch, ctxt.Out, ldr, s, rr, int64(uint64(ldr.SymValue(s)+int64(r.Off()))-base)) {
|
||||
ctxt.Errorf(s, "unsupported obj reloc %d/%d to %s", r.Type(), r.Siz(), ldr.SymName(r.Sym()))
|
||||
ctxt.Errorf(s, "unsupported obj reloc %v/%d to %s", r.Type(), r.Siz(), ldr.SymName(r.Sym()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue