From c16182680c9ac8ad65f8ff38f6ae170feb0d33c7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 17 Sep 2015 07:20:58 +0000 Subject: new dlstart stage-2 chaining for powerpc --- arch/powerpc/reloc.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/powerpc/reloc.h b/arch/powerpc/reloc.h index aa5f8c93..b8b6589f 100644 --- a/arch/powerpc/reloc.h +++ b/arch/powerpc/reloc.h @@ -13,3 +13,12 @@ #define CRTJMP(pc,sp) __asm__ __volatile__( \ "mr 1,%1 ; mtlr %0 ; blr" : : "r"(pc), "r"(sp) : "memory" ) + +#define GETFUNCSYM(fp, sym, got) __asm__ ( \ + ".hidden " #sym " \n" \ + " bl 1f \n" \ + " .long " #sym "-. \n" \ + "1: mflr %1 \n" \ + " lwz %0, 0(%1) \n" \ + " add %0, %0, %1 \n" \ + : "=r"(*(fp)), "=r"((int){0}) : : "memory", "lr" ) -- cgit v1.2.3-70-g09d2