opal-prd: Fix opal-prd crash
opal-prd: Fix opal-prd crash

Presently callback function from HBRT uses r11 to point to target function
pointer. r12 is garbage. This works fine when we compile with "-no-pie" option
(as we don't use r12 to calculate TOC).

As per ABIv2 : "r12 : Function entry address at global entry point"

With "-pie" compilation option, we have to set r12 to point to global function
entry point. So that we can calculate TOC properly.

Crash log without this patch:
  opal-prd[2864]: unhandled signal 11 at 0000000000029320 nip 00000 00102012830 lr 0000000102016890 code 1

Signed-off-by: Vasant Hegde <a6d753843573f7bfed5075c1e875b0be8007a0ab@linux.vnet.ibm.com>
CC: Jeremy Kerr <68a658b44bbaefab3ef5cd231967195fc0ff9d69@ozlabs.org>
CC: Mahesh Salgaonkar <6a890e1065a1d4e8df9dcf1d9a2c9c740bbcf8aa@linux.vnet.ibm.com>
Acked-by: Jeremy Kerr <68a658b44bbaefab3ef5cd231967195fc0ff9d69@ozlabs.org>
Reviewed-by: Mahesh Salgaonkar <6a890e1065a1d4e8df9dcf1d9a2c9c740bbcf8aa@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <ec31ab75ddf977353c8f660f92ea8b23f64aef25@linux.ibm.com>

legoater/skiboot,shenki/skiboot,qemu/skiboot,open-power/skiboot,shenki/skiboot,legoater/skiboot,legoater/skiboot,open-power/skiboot,legoater/skiboot,stewart-ibm/skiboot,qemu/skiboot,shenki/skiboot,open-power/skiboot,qemu/skiboot,shenki/skiboot,open-power/skiboot,stewart-ibm/skiboot,qemu/skiboot,legoater/skiboot,open-power/skiboot,qemu/skiboot,stewart-ibm/skiboot,shenki/skiboot