mirror of
https://github.com/golang/go.git
synced 2025-05-30 19:52:53 +00:00
cmd/link: emit correct jump instruction on ARM for DYNIMPORT
On ARM, for a JMP/CALL relocation, the instruction bytes is encoded in Reloc.Add (issue #19811). I really hate it, but before it is fixed we have to follow the rule and emit the right bits from r.Add. Fixes #40769. Change-Id: I862e105408d344c5cc58ca9140d2e552e4364453 Reviewed-on: https://go-review.googlesource.com/c/go/+/248399 Reviewed-by: Jeremy Faller <jeremy@golang.org> Reviewed-by: Joel Sing <joel@sing.id.au> Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
7ee2622443
commit
a2a2237ae0
@ -220,7 +220,7 @@ func adddynrel(target *ld.Target, ldr *loader.Loader, syms *ld.ArchSyms, s loade
|
||||
addpltsym(target, ldr, syms, targ)
|
||||
su := ldr.MakeSymbolUpdater(s)
|
||||
su.SetRelocSym(rIdx, syms.PLT)
|
||||
su.SetRelocAdd(rIdx, int64(ldr.SymPlt(targ)))
|
||||
su.SetRelocAdd(rIdx, int64(braddoff(int32(r.Add()), ldr.SymPlt(targ)/4))) // TODO: don't use r.Add for instruction bytes (issue 19811)
|
||||
return true
|
||||
|
||||
case objabi.R_ADDR:
|
||||
|
Loading…
x
Reference in New Issue
Block a user