elf.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef __ASMARM_ELF_H
  2. #define __ASMARM_ELF_H
  3. /*
  4. * ELF register definitions..
  5. */
  6. #include <asm/ptrace.h>
  7. #include <asm/procinfo.h>
  8. //FIXME - is it always 32K ?
  9. #define ELF_EXEC_PAGESIZE 32768
  10. #define SET_PERSONALITY(ex,ibcs2) set_personality(PER_LINUX)
  11. typedef unsigned long elf_greg_t;
  12. typedef unsigned long elf_freg_t[3];
  13. #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  14. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  15. typedef struct { void *null; } elf_fpregset_t;
  16. /*
  17. * This is used to ensure we don't load something for the wrong architecture.
  18. * We can only execute 26-bit code.
  19. */
  20. #define EM_ARM 40
  21. #define EF_ARM_APCS26 0x08
  22. //#define elf_check_arch(x) ( ((x)->e_machine == EM_ARM) && ((x)->e_flags & EF_ARM_APCS26) ) FIXME!!!!! - this looks OK, but the flags seem to be wrong.
  23. #define elf_check_arch(x) (1)
  24. /*
  25. * These are used to set parameters in the core dumps.
  26. */
  27. #define ELF_CLASS ELFCLASS32
  28. #define ELF_DATA ELFDATA2LSB
  29. #define ELF_ARCH EM_ARM
  30. #define USE_ELF_CORE_DUMP
  31. /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
  32. use of this is to invoke "./ld.so someprog" to test out a new version of
  33. the loader. We need to make sure that it is out of the way of the program
  34. that it will "exec", and that there is sufficient room for the brk. */
  35. #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
  36. /* When the program starts, a1 contains a pointer to a function to be
  37. registered with atexit, as per the SVR4 ABI. A value of 0 means we
  38. have no such handler. */
  39. #define ELF_PLAT_INIT(_r, load_addr) (_r)->ARM_r0 = 0
  40. /* This yields a mask that user programs can use to figure out what
  41. instruction set this cpu supports. */
  42. extern unsigned int elf_hwcap;
  43. #define ELF_HWCAP (elf_hwcap)
  44. /* This yields a string that ld.so will use to load implementation
  45. specific libraries for optimization. This is more specific in
  46. intent than poking at uname or /proc/cpuinfo. */
  47. /* For now we just provide a fairly general string that describes the
  48. processor family. This could be made more specific later if someone
  49. implemented optimisations that require it. 26-bit CPUs give you
  50. "v1l" for ARM2 (no SWP) and "v2l" for anything else (ARM1 isn't
  51. supported).
  52. */
  53. #define ELF_PLATFORM_SIZE 8
  54. extern char elf_platform[];
  55. #define ELF_PLATFORM (elf_platform)
  56. #endif