new dlstart stage-2 chaining for powerpc

This commit is contained in:
Rich Felker 2015-09-17 07:20:58 +00:00
parent 4761e63bc4
commit c16182680c
1 changed files with 9 additions and 0 deletions

View File

@ -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" )