dl-sysdep.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * Various assmbly language/system dependent hacks that are required
  4. * so that we can minimize the amount of platform specific code.
  5. * Copyright (C) 2000-2004 by Erik Andersen <andersen@codpoet.org>
  6. */
  7. /* Define this if the system uses RELOCA. */
  8. #undef ELF_USES_RELOCA
  9. /* Initialization sequence for the GOT. */
  10. #define INIT_GOT(GOT_BASE,MODULE) \
  11. do { \
  12. GOT_BASE[2] = (unsigned long) _dl_linux_resolve; \
  13. GOT_BASE[1] = (unsigned long) MODULE; \
  14. } while(0)
  15. /* Here we define the magic numbers that this dynamic loader should accept */
  16. #define MAGIC1 EM_386
  17. #undef MAGIC2
  18. /* Used for error messages */
  19. #define ELF_TARGET "386"
  20. struct elf_resolve;
  21. extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
  22. #define do_rem(result, n, base) result = (n % base)
  23. /* 4096 bytes alignment */
  24. #define PAGE_ALIGN 0xfffff000
  25. #define ADDR_ALIGN 0xfff
  26. #define OFFS_ALIGN 0x7ffff000
  27. /* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
  28. TLS variable, so undefined references should not be allowed to
  29. define the value.
  30. ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
  31. of the main executable's symbols, as for a COPY reloc. */
  32. #define elf_machine_type_class(type) \
  33. ((((type) == R_386_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
  34. | (((type) == R_386_COPY) * ELF_RTYPE_CLASS_COPY))