mirror of
https://github.com/golang/go
synced 2024-11-22 15:34:53 -07:00
[dev.boringcrypto] cmd/link: implement R_X86_64_PC64 relocations
Change-Id: I1d7bd5cff7350a4e0f78b8efc8406e79c74732d1 Reviewed-on: https://go-review.googlesource.com/55370 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/55470 Run-TryBot: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
048c9cfaac
commit
19b89a22df
@ -118,6 +118,17 @@ func adddynrel(ctxt *ld.Link, s *ld.Symbol, r *ld.Reloc) bool {
|
||||
r.Add += 4
|
||||
return true
|
||||
|
||||
case 256 + ld.R_X86_64_PC64:
|
||||
if targ.Type == ld.SDYNIMPORT {
|
||||
ld.Errorf(s, "unexpected R_X86_64_PC64 relocation for dynamic symbol %s", targ.Name)
|
||||
}
|
||||
if targ.Type == 0 || targ.Type == ld.SXREF {
|
||||
ld.Errorf(s, "unknown symbol %s in pcrel", targ.Name)
|
||||
}
|
||||
r.Type = objabi.R_PCREL
|
||||
r.Add += 8
|
||||
return true
|
||||
|
||||
case 256 + ld.R_X86_64_PLT32:
|
||||
r.Type = objabi.R_PCREL
|
||||
r.Add += 4
|
||||
|
@ -1210,6 +1210,7 @@ func relSize(ctxt *Link, pn string, elftype uint32) uint8 {
|
||||
return 4
|
||||
|
||||
case AMD64 | R_X86_64_64<<24,
|
||||
AMD64 | R_X86_64_PC64<<24,
|
||||
PPC64 | R_PPC64_ADDR64<<24,
|
||||
S390X | R_390_GLOB_DAT<<24,
|
||||
S390X | R_390_RELATIVE<<24,
|
||||
|
Loading…
Reference in New Issue
Block a user