From 4761e63bc4d1ae2e3298fcee1fddced94281d9e7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 17 Sep 2015 07:20:51 +0000 Subject: [PATCH] new dlstart stage-2 chaining for or1k --- arch/or1k/reloc.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/or1k/reloc.h b/arch/or1k/reloc.h index ddee45c5..128089ca 100644 --- a/arch/or1k/reloc.h +++ b/arch/or1k/reloc.h @@ -13,3 +13,12 @@ #define CRTJMP(pc,sp) __asm__ __volatile__( \ "l.jr %0 ; l.ori r1,%1,0" : : "r"(pc), "r"(sp) : "memory" ) + +#define GETFUNCSYM(fp, sym, got) __asm__ ( \ + ".hidden " #sym " \n" \ + " l.jal 1f \n" \ + " l.nop \n" \ + " .word " #sym "-. \n" \ + "1: l.lwz %0, 0(r9) \n" \ + " l.add %0, %0, r9 \n" \ + : "=r"(*(fp)) : : "memory", "r9" ) -- GitLab