mirror of https://github.com/golang/go.git
cmd/link: support R_PPC64_REL24_P9NOTOC
This can be treated identically to R_PPC64_REL24_NOTOC as stubs are generated based on GOPPC64 and -buildmode. Change-Id: I3c42a9bf3c08d107fb656e6bf59b2307783bd9af Reviewed-on: https://go-review.googlesource.com/c/go/+/497915 Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Paul Murphy <murp@ibm.com>
This commit is contained in:
parent
f07901dc4e
commit
e946f0e1ff
|
|
@ -1066,6 +1066,7 @@ func relSize(arch *sys.Arch, pn string, elftype uint32) (uint8, uint8, error) {
|
|||
I386 | uint32(elf.R_386_GOT32X)<<16,
|
||||
PPC64 | uint32(elf.R_PPC64_REL24)<<16,
|
||||
PPC64 | uint32(elf.R_PPC64_REL24_NOTOC)<<16,
|
||||
PPC64 | uint32(elf.R_PPC64_REL24_P9NOTOC)<<16,
|
||||
PPC64 | uint32(elf.R_PPC_REL32)<<16,
|
||||
S390X | uint32(elf.R_390_32)<<16,
|
||||
S390X | uint32(elf.R_390_PC32)<<16,
|
||||
|
|
|
|||
|
|
@ -304,6 +304,10 @@ func genstubs(ctxt *ld.Link, ldr *loader.Loader) {
|
|||
}
|
||||
}
|
||||
|
||||
case objabi.ElfRelocOffset + objabi.RelocType(elf.R_PPC64_REL24_P9NOTOC):
|
||||
// This can be treated identically to R_PPC64_REL24_NOTOC, as stubs are determined by
|
||||
// GOPPC64 and -buildmode.
|
||||
fallthrough
|
||||
case objabi.ElfRelocOffset + objabi.RelocType(elf.R_PPC64_REL24_NOTOC):
|
||||
switch ldr.SymType(r.Sym()) {
|
||||
case sym.SDYNIMPORT:
|
||||
|
|
@ -602,13 +606,14 @@ func addelfdynrel(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, s lo
|
|||
}
|
||||
|
||||
// Handle relocations found in ELF object files.
|
||||
case objabi.ElfRelocOffset + objabi.RelocType(elf.R_PPC64_REL24_NOTOC):
|
||||
case objabi.ElfRelocOffset + objabi.RelocType(elf.R_PPC64_REL24_NOTOC),
|
||||
objabi.ElfRelocOffset + objabi.RelocType(elf.R_PPC64_REL24_P9NOTOC):
|
||||
su := ldr.MakeSymbolUpdater(s)
|
||||
su.SetRelocType(rIdx, objabi.R_CALLPOWER)
|
||||
|
||||
if targType == sym.SDYNIMPORT {
|
||||
// Should have been handled in elfsetupplt
|
||||
ldr.Errorf(s, "unexpected R_PPC64_REL24_NOTOC for dyn import")
|
||||
ldr.Errorf(s, "unexpected R_PPC64_REL24_NOTOC/R_PPC64_REL24_P9NOTOC for dyn import")
|
||||
}
|
||||
return true
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue