elf.h 2.1 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_32_PCREL 0x31
  21. /*to set parameters in the core dumps */
  22. #define ELF_ARCH EM_ARCOMPACT
  23. #define ELF_CLASS ELFCLASS32
  24. #ifdef CONFIG_CPU_BIG_ENDIAN
  25. #define ELF_DATA ELFDATA2MSB
  26. #else
  27. #define ELF_DATA ELFDATA2LSB
  28. #endif
  29. /*
  30. * To ensure that
  31. * -we don't load something for the wrong architecture.
  32. * -The userspace is using the correct syscall ABI
  33. */
  34. struct elf32_hdr;
  35. extern int elf_check_arch(const struct elf32_hdr *);
  36. #define elf_check_arch elf_check_arch
  37. #define CORE_DUMP_USE_REGSET
  38. #define ELF_EXEC_PAGESIZE PAGE_SIZE
  39. /*
  40. * This is the location that an ET_DYN program is loaded if exec'ed. Typical
  41. * use of this is to invoke "./ld.so someprog" to test out a new version of
  42. * the loader. We need to make sure that it is out of the way of the program
  43. * that it will "exec", and that there is sufficient room for the brk.
  44. */
  45. #define ELF_ET_DYN_BASE (2UL * TASK_SIZE / 3)
  46. /*
  47. * When the program starts, a1 contains a pointer to a function to be
  48. * registered with atexit, as per the SVR4 ABI. A value of 0 means we
  49. * have no such handler.
  50. */
  51. #define ELF_PLAT_INIT(_r, load_addr) ((_r)->r0 = 0)
  52. /*
  53. * This yields a mask that user programs can use to figure out what
  54. * instruction set this cpu supports.
  55. */
  56. #define ELF_HWCAP (0)
  57. /*
  58. * This yields a string that ld.so will use to load implementation
  59. * specific libraries for optimization. This is more specific in
  60. * intent than poking at uname or /proc/cpuinfo.
  61. */
  62. #define ELF_PLATFORM (NULL)
  63. #endif