• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #if __BYTE_ORDER == __LITTLE_ENDIAN
2 #define ENDIAN_SUFFIX "le"
3 #else
4 #define ENDIAN_SUFFIX ""
5 #endif
6 
7 #define LDSO_ARCH "powerpc64" ENDIAN_SUFFIX
8 
9 #define TPOFF_K (-0x7000)
10 
11 #define REL_SYMBOLIC    R_PPC64_ADDR64
12 #define REL_USYMBOLIC   R_PPC64_UADDR64
13 #define REL_GOT         R_PPC64_GLOB_DAT
14 #define REL_PLT         R_PPC64_JMP_SLOT
15 #define REL_RELATIVE    R_PPC64_RELATIVE
16 #define REL_COPY        R_PPC64_COPY
17 #define REL_DTPMOD      R_PPC64_DTPMOD64
18 #define REL_DTPOFF      R_PPC64_DTPREL64
19 #define REL_TPOFF       R_PPC64_TPREL64
20 
21 #define CRTJMP(pc,sp) __asm__ __volatile__( \
22 	"mr 1,%1; mr 12,%0; mtctr 12; bctrl" : : "r"(pc), "r"(sp) : "memory" )
23 
24 #define GETFUNCSYM(fp, sym, got) __asm__ ( \
25 	".hidden " #sym " \n" \
26 	"	bl 1f \n" \
27 	"	.long " #sym "-. \n" \
28 	"1:	mflr %1 \n" \
29 	"	lwa %0, 0(%1) \n" \
30 	"	add %0, %0, %1 \n" \
31 	: "=r"(*(fp)), "=r"((long){0}) : : "memory", "lr" )
32