Commit f1b91957 authored by Ian Lance Taylor's avatar Ian Lance Taylor

cmd/link: support R_PPC_REL32 relocation

This relocation is found in libgcc.a in the .eh_frame, and therefore
needs to be handled when doing an internal link.

Fixes #13375.

Change-Id: Idd9e8178e08851a101b43261a30939bcfaf394f9
Reviewed-on: https://go-review.googlesource.com/17173
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarMichael Hudson-Doyle <michael.hudson@canonical.com>
parent 009517e0
......@@ -1159,7 +1159,8 @@ func reltype(pn string, elftype int, siz *uint8) int {
'8' | R_386_GOTOFF<<24,
'8' | R_386_GOTPC<<24,
'8' | R_386_GOT32X<<24,
'9' | R_PPC64_REL24<<24:
'9' | R_PPC64_REL24<<24,
'9' | R_PPC_REL32<<24:
*siz = 4
case '6' | R_X86_64_64<<24,
......
......@@ -296,6 +296,16 @@ func adddynrel(s *ld.LSym, r *ld.Reloc) {
return
case 256 + ld.R_PPC_REL32:
r.Type = obj.R_PCREL
r.Add += 4
if targ.Type == obj.SDYNIMPORT {
ld.Diag("unexpected R_PPC_REL32 for dyn import")
}
return
case 256 + ld.R_PPC64_ADDR64:
r.Type = obj.R_ADDR
if targ.Type == obj.SDYNIMPORT {
......
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