reloc.h 855 B

12345678910111213141516171819202122232425262728293031
  1. #if defined(_SOFT_FLOAT) || defined(__NO_FPRS__)
  2. #define FP_SUFFIX "-sf"
  3. #else
  4. #define FP_SUFFIX ""
  5. #endif
  6. #define LDSO_ARCH "powerpc" FP_SUFFIX
  7. #define TPOFF_K (-0x7000)
  8. #define REL_SYMBOLIC R_PPC_ADDR32
  9. #define REL_USYMBOLIC R_PPC_UADDR32
  10. #define REL_GOT R_PPC_GLOB_DAT
  11. #define REL_PLT R_PPC_JMP_SLOT
  12. #define REL_RELATIVE R_PPC_RELATIVE
  13. #define REL_COPY R_PPC_COPY
  14. #define REL_DTPMOD R_PPC_DTPMOD32
  15. #define REL_DTPOFF R_PPC_DTPREL32
  16. #define REL_TPOFF R_PPC_TPREL32
  17. #define CRTJMP(pc,sp) __asm__ __volatile__( \
  18. "mr 1,%1 ; mtlr %0 ; blr" : : "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. " lwz %0, 0(%1) \n" \
  25. " add %0, %0, %1 \n" \
  26. : "=r"(*(fp)), "=r"((int){0}) : : "memory", "lr" )