reloc.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #if __mips_isa_rev >= 6
  2. #define ISA_SUFFIX "r6"
  3. #else
  4. #define ISA_SUFFIX ""
  5. #endif
  6. #if __BYTE_ORDER == __LITTLE_ENDIAN
  7. #define ENDIAN_SUFFIX "el"
  8. #else
  9. #define ENDIAN_SUFFIX ""
  10. #endif
  11. #ifdef __mips_soft_float
  12. #define FP_SUFFIX "-sf"
  13. #else
  14. #define FP_SUFFIX ""
  15. #endif
  16. #define LDSO_ARCH "mipsn32" ISA_SUFFIX ENDIAN_SUFFIX FP_SUFFIX
  17. #define TPOFF_K (-0x7000)
  18. #define REL_SYM_OR_REL R_MIPS_REL32
  19. #define REL_PLT R_MIPS_JUMP_SLOT
  20. #define REL_COPY R_MIPS_COPY
  21. #define REL_DTPMOD R_MIPS_TLS_DTPMOD32
  22. #define REL_DTPOFF R_MIPS_TLS_DTPREL32
  23. #define REL_TPOFF R_MIPS_TLS_TPREL32
  24. #define NEED_MIPS_GOT_RELOCS 1
  25. #define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP
  26. #define DT_DEBUG_INDIRECT_REL DT_MIPS_RLD_MAP_REL
  27. #define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
  28. #define CRTJMP(pc,sp) __asm__ __volatile__( \
  29. "move $sp,%1 ; jr %0" : : "r"(pc), "r"(sp) : "memory" )
  30. #define GETFUNCSYM(fp, sym, got) __asm__ ( \
  31. ".hidden " #sym "\n" \
  32. ".set push \n" \
  33. ".set noreorder \n" \
  34. " bal 1f \n" \
  35. " nop \n" \
  36. " .gpword . \n" \
  37. " .gpword " #sym " \n" \
  38. "1: lw %0, ($ra) \n" \
  39. " subu %0, $ra, %0 \n" \
  40. " lw $ra, 4($ra) \n" \
  41. " addu %0, %0, $ra \n" \
  42. ".set pop \n" \
  43. : "=r"(*(fp)) : : "memory", "ra" )