dl-sysdep.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* vi: set sw=8 ts=8: */
  2. /*
  3. * Various assmbly language/system dependent hacks that are required
  4. * so that we can minimize the amount of platform specific code.
  5. */
  6. /* Define this if the system uses RELOCA. */
  7. #undef ELF_USES_RELOCA
  8. /* Initialization sequence for the application/library GOT. */
  9. #define INIT_GOT(GOT_BASE,MODULE) \
  10. do { \
  11. unsigned long i; \
  12. \
  13. /* Check if this is the dynamic linker itself */ \
  14. if (MODULE->libtype == program_interpreter) \
  15. continue; \
  16. \
  17. /* Fill in first two GOT entries according to the ABI */ \
  18. GOT_BASE[0] = (unsigned long) _dl_linux_resolve; \
  19. GOT_BASE[1] = (unsigned long) MODULE; \
  20. \
  21. /* Add load address displacement to all local GOT entries */ \
  22. i = 2; \
  23. while (i < MODULE->mips_local_gotno) \
  24. GOT_BASE[i++] += (unsigned long) MODULE->loadaddr; \
  25. \
  26. } while (0)
  27. /* Here we define the magic numbers that this dynamic loader should accept */
  28. #define MAGIC1 EM_MIPS
  29. #define MAGIC2 EM_MIPS_RS3_LE
  30. /* Used for error messages */
  31. #define ELF_TARGET "MIPS"
  32. unsigned long _dl_linux_resolver(unsigned long sym_index,
  33. unsigned long old_gpreg);
  34. struct elf_resolve;
  35. void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt);
  36. #define do_rem(result, n, base) ((result) = (n) % (base))
  37. /* 4096 bytes alignment */
  38. #define PAGE_ALIGN 0xfffff000
  39. #define ADDR_ALIGN 0xfff
  40. #define OFFS_ALIGN 0x7ffff000
  41. #define elf_machine_type_class(type) ELF_RTYPE_CLASS_PLT
  42. /* MIPS does not have COPY relocs */
  43. #define DL_NO_COPY_RELOCS