mirror of
https://github.com/golang/go
synced 2024-09-04 23:44:16 +00:00
cmd/link: don't cast end address to int32
When linking a very large binary, the section address may not fit in int32. Don't truncate it. Change-Id: Ibcc8d74bf5662611949e547ce44ca8b973de383f Reviewed-on: https://go-review.googlesource.com/c/go/+/319289 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
485474d204
commit
af0f8c149e
|
@ -1171,7 +1171,7 @@ func elfrelocsect(ctxt *Link, out *OutBuf, sect *sym.Section, syms []loader.Sym)
|
|||
}
|
||||
}
|
||||
|
||||
eaddr := int32(sect.Vaddr + sect.Length)
|
||||
eaddr := sect.Vaddr + sect.Length
|
||||
for _, s := range syms {
|
||||
if !ldr.AttrReachable(s) {
|
||||
continue
|
||||
|
|
|
@ -1194,7 +1194,7 @@ func machorelocsect(ctxt *Link, out *OutBuf, sect *sym.Section, syms []loader.Sy
|
|||
}
|
||||
}
|
||||
|
||||
eaddr := int32(sect.Vaddr + sect.Length)
|
||||
eaddr := sect.Vaddr + sect.Length
|
||||
for _, s := range syms {
|
||||
if !ldr.AttrReachable(s) {
|
||||
continue
|
||||
|
|
Loading…
Reference in a new issue