From 99c8479cc6b9cac330eecb041e6f13479322c0d2 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 25 Nov 2014 16:00:25 -0500 Subject: [dev.cc] 9l: make R_CALLPOWER like ELF's R_PPC64_REL24 These accomplished the same thing, but R_CALLPOWER expected the whole instruction to be in the addend (and completely overwrote what was in the text section), while R_PPC64_REL24 overwrites only bits 6 through 24 of whatever was in the text section. Make R_CALLPOWER work like R_PPC64_REL24 to ease the implementation of dynamic linking. LGTM=rsc R=rsc CC=golang-codereviews, minux https://codereview.appspot.com/177430043 --- src/liblink/asm9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/liblink') diff --git a/src/liblink/asm9.c b/src/liblink/asm9.c index 3c125b3b0..5a379270d 100644 --- a/src/liblink/asm9.c +++ b/src/liblink/asm9.c @@ -1589,7 +1589,7 @@ asmout(Link *ctxt, Prog *p, Optab *o, int32 *out) ctxt->diag("odd branch target address\n%P", p); v &= ~03; } - rel->add = o1 | (v & 0x03FFFFFC); + rel->add = v; rel->type = R_CALLPOWER; } break; -- cgit v1.2.1