elf.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef __ASM_ARC_ELF_H
  9. #define __ASM_ARC_ELF_H
  10. #include <asm/ptrace.h>
  11. #define EM_ARCOMPACT 93
  12. /* Machine specific ELF Hdr flags */
  13. #define EF_ARC_OSABI_MSK 0x00000f00
  14. #define EF_ARC_OSABI_ORIG 0x00000000 /* MUST be zero for back-compat */
  15. #define EF_ARC_OSABI_V2 0x00000200
  16. /* ARC Relocations (kernel Modules only) */
  17. #define R_ARC_32 0x4
  18. #define R_ARC_32_ME 0x1B
  19. #define R_ARC_S25H_PCREL 0x10
  20. #define R_ARC_S25W_PCREL 0x11
  21. typedef unsigned long elf_greg_t;
  22. typedef unsigned long elf_fpregset_t;
  23. /* core dump regs is in the order pt_regs, callee_regs, stop_pc (for gdb) */
  24. #define ELF_NGREG ((sizeof(struct pt_regs) + sizeof(struct callee_regs) \
  25. + sizeof(unsigned long)) / sizeof(elf_greg_t))
  26. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  27. /*
  28. * To ensure that
  29. * -we don't load something for the wrong architecture.
  30. * -The userspace is using the correct syscall ABI
  31. */
  32. struct elf32_hdr;
  33. extern int elf_check_arch(const struct elf32_hdr *);
  34. #define elf_check_arch elf_check_arch
  35. /*
  36. * These are used to set parameters in the core dumps.
  37. */
  38. #define ELF_ARCH EM_ARCOMPACT
  39. #define ELF_CLASS ELFCLASS32
  40. #ifdef CONFIG_CPU_BIG_ENDIAN
  41. #define ELF_DATA ELFDATA2MSB
  42. #else
  43. #define ELF_DATA ELFDATA2LSB
  44. #endif
  45. #ifdef __KERNEL__
  46. #define CORE_DUMP_USE_REGSET
  47. #define ELF_EXEC_PAGESIZE PAGE_SIZE
  48. /*
  49. * This is the location that an ET_DYN program is loaded if exec'ed. Typical
  50. * use of this is to invoke "./ld.so someprog" to test out a new version of
  51. * the loader. We need to make sure that it is out of the way of the program
  52. * that it will "exec", and that there is sufficient room for the brk.
  53. */
  54. #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
  55. /*
  56. * When the program starts, a1 contains a pointer to a function to be
  57. * registered with atexit, as per the SVR4 ABI. A value of 0 means we
  58. * have no such handler.
  59. */
  60. #define ELF_PLAT_INIT(_r, load_addr) ((_r)->r0 = 0)
  61. /*
  62. * This yields a mask that user programs can use to figure out what
  63. * instruction set this cpu supports.
  64. */
  65. #define ELF_HWCAP (0)
  66. /*
  67. * This yields a string that ld.so will use to load implementation
  68. * specific libraries for optimization. This is more specific in
  69. * intent than poking at uname or /proc/cpuinfo.
  70. */
  71. #define ELF_PLATFORM (NULL)
  72. #define SET_PERSONALITY(ex) \
  73. set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
  74. #endif /* __KERNEL__ */
  75. #endif