dl-sysdep.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #define do_rem(result, n, base) result = (n % base)
  35. /* 4096 bytes alignment */
  36. #define PAGE_ALIGN 0xfffff000
  37. #define ADDR_ALIGN 0xfff
  38. #define OFFS_ALIGN 0x7ffff000
  39. #define elf_machine_type_class(type) ELF_RTYPE_CLASS_PLT