From 6e46fc0f13c00998f0932f03649b5010202567a2 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Wed, 13 May 2020 21:09:53 -0500 Subject: [PATCH] Change register usage in .glink resolver stub We were previously using r0 in a position where it would be treated as constant zero. Chose to use r12 there instead as it is available at that point. Fixes #85. Signed-off-by: Bill Schmidt --- specification/ch_4.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/ch_4.xml b/specification/ch_4.xml index 10f8603..8427354 100644 --- a/specification/ch_4.xml +++ b/specification/ch_4.xml @@ -1084,9 +1084,9 @@ bctr mtlr r0 # Compute .plt section index from entry point address in r12 # .plt section index is placed into r0 as argument to the resolver - sub r0,r12,r11 - subi r0,r0,res_0-1b - srdi r0,r0,2 + sub r12,r12,r11 + subi r12,r12,res_0-1b + srdi r0,r12,2 # Load address of the first byte of the PLT ld r12,PLToffset-1b(r11) add r11,r12,r11