elf.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  4. */
  5. #ifndef __ASM_ARC_ELF_H
  6. #define __ASM_ARC_ELF_H
  7. #include <linux/types.h>
  8. #include <linux/elf-em.h>
  9. #include <uapi/asm/elf.h>
  10. #define EM_ARC_INUSE (IS_ENABLED(CONFIG_ISA_ARCOMPACT) ? \
  11. EM_ARCOMPACT : EM_ARCV2)
  12. /* ARC Relocations (kernel Modules only) */
  13. #define R_ARC_32 0x4
  14. #define R_ARC_32_ME 0x1B
  15. #define R_ARC_32_PCREL 0x31
  16. /*to set parameters in the core dumps */
  17. #define ELF_ARCH EM_ARC_INUSE
  18. #define ELF_CLASS ELFCLASS32
  19. #ifdef CONFIG_CPU_BIG_ENDIAN
  20. #define ELF_DATA ELFDATA2MSB
  21. #else
  22. #define ELF_DATA ELFDATA2LSB
  23. #endif
  24. /*
  25. * To ensure that
  26. * -we don't load something for the wrong architecture.
  27. * -The userspace is using the correct syscall ABI
  28. */
  29. struct elf32_hdr;
  30. extern int elf_check_arch(const struct elf32_hdr *);
  31. #define elf_check_arch elf_check_arch
  32. #define CORE_DUMP_USE_REGSET
  33. #define ELF_EXEC_PAGESIZE PAGE_SIZE
  34. /*
  35. * This is the location that an ET_DYN program is loaded if exec'ed. Typical
  36. * use of this is to invoke "./ld.so someprog" to test out a new version of
  37. * the loader. We need to make sure that it is out of the way of the program
  38. * that it will "exec", and that there is sufficient room for the brk.
  39. */
  40. #define ELF_ET_DYN_BASE (2UL * TASK_SIZE / 3)
  41. /*
  42. * When the program starts, a1 contains a pointer to a function to be
  43. * registered with atexit, as per the SVR4 ABI. A value of 0 means we
  44. * have no such handler.
  45. */
  46. #define ELF_PLAT_INIT(_r, load_addr) ((_r)->r0 = 0)
  47. /*
  48. * This yields a mask that user programs can use to figure out what
  49. * instruction set this cpu supports.
  50. */
  51. #define ELF_HWCAP (0)
  52. /*
  53. * This yields a string that ld.so will use to load implementation
  54. * specific libraries for optimization. This is more specific in
  55. * intent than poking at uname or /proc/cpuinfo.
  56. */
  57. #define ELF_PLATFORM (NULL)
  58. #endif