reloc.h 885 B

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