Commit ef6978b2 authored by Russ Cox's avatar Russ Cox

cmd/link: implement R_X86_64_PC64 relocations

Change-Id: I1d7bd5cff7350a4e0f78b8efc8406e79c74732d1
Reviewed-on: https://go-review.googlesource.com/55370Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 9223adcc
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment