elf.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 <linux/types.h>
  11. #include <uapi/asm/elf.h>
  12. /* These ELF defines belong to uapi but libc elf.h already defines them */
  13. #define EM_ARCOMPACT 93
  14. #define EM_ARCV2 195 /* ARCv2 Cores */
  15. #define EM_ARC_INUSE (IS_ENABLED(CONFIG_ISA_ARCOMPACT) ? \
  16. EM_ARCOMPACT : EM_ARCV2)
  17. /* ARC Relocations (kernel Modules only) */
  18. #define R_ARC_32 0x4
  19. #define R_ARC_32_ME 0x1B
  20. #define R_ARC_S25H_PCREL 0x10
  21. #define R_ARC_S25W_PCREL 0x11
  22. /*to set parameters in the core dumps */
  23. #define ELF_ARCH EM_ARCOMPACT
  24. #define ELF_CLASS ELFCLASS32
  25. #ifdef CONFIG_CPU_BIG_ENDIAN
  26. #define ELF_DATA ELFDATA2MSB
  27. #else
  28. #define ELF_DATA ELFDATA2LSB
  29. #endif
  30. /*
  31. * To ensure that
  32. * -we don't load something for the wrong architecture.
  33. * -The userspace is using the correct syscall ABI
  34. */
  35. struct elf32_hdr;
  36. extern int elf_check_arch(const struct elf32_hdr *);
  37. #define elf_check_arch elf_check_arch
  38. #define CORE_DUMP_USE_REGSET
  39. #define ELF_EXEC_PAGESIZE PAGE_SIZE
  40. /*
  41. * This is the location that an ET_DYN program is loaded if exec'ed. Typical
  42. * use of this is to invoke "./ld.so someprog" to test out a new version of
  43. * the loader. We need to make sure that it is out of the way of the program
  44. * that it will "exec", and that there is sufficient room for the brk.
  45. */
  46. #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
  47. /*
  48. * When the program starts, a1 contains a pointer to a function to be
  49. * registered with atexit, as per the SVR4 ABI. A value of 0 means we
  50. * have no such handler.
  51. */
  52. #define ELF_PLAT_INIT(_r, load_addr) ((_r)->r0 = 0)
  53. /*
  54. * This yields a mask that user programs can use to figure out what
  55. * instruction set this cpu supports.
  56. */
  57. #define ELF_HWCAP (0)
  58. /*
  59. * This yields a string that ld.so will use to load implementation
  60. * specific libraries for optimization. This is more specific in
  61. * intent than poking at uname or /proc/cpuinfo.
  62. */
  63. #define ELF_PLATFORM (NULL)
  64. #endif