elf.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _LINUX_ELF_H
  2. #define _LINUX_ELF_H
  3. #include <asm/elf.h>
  4. #include <uapi/linux/elf.h>
  5. #ifndef elf_read_implies_exec
  6. /* Executables for which elf_read_implies_exec() returns TRUE will
  7. have the READ_IMPLIES_EXEC personality flag set automatically.
  8. Override in asm/elf.h as needed. */
  9. # define elf_read_implies_exec(ex, have_pt_gnu_stack) 0
  10. #endif
  11. #ifndef SET_PERSONALITY
  12. #define SET_PERSONALITY(ex) \
  13. set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
  14. #endif
  15. #ifndef SET_PERSONALITY2
  16. #define SET_PERSONALITY2(ex, state) \
  17. SET_PERSONALITY(ex)
  18. #endif
  19. #if ELF_CLASS == ELFCLASS32
  20. extern Elf32_Dyn _DYNAMIC [];
  21. #define elfhdr elf32_hdr
  22. #define elf_phdr elf32_phdr
  23. #define elf_shdr elf32_shdr
  24. #define elf_note elf32_note
  25. #define elf_addr_t Elf32_Off
  26. #define Elf_Half Elf32_Half
  27. #else
  28. extern Elf64_Dyn _DYNAMIC [];
  29. #define elfhdr elf64_hdr
  30. #define elf_phdr elf64_phdr
  31. #define elf_shdr elf64_shdr
  32. #define elf_note elf64_note
  33. #define elf_addr_t Elf64_Off
  34. #define Elf_Half Elf64_Half
  35. #endif
  36. /* Optional callbacks to write extra ELF notes. */
  37. struct file;
  38. struct coredump_params;
  39. #ifndef ARCH_HAVE_EXTRA_ELF_NOTES
  40. static inline int elf_coredump_extra_notes_size(void) { return 0; }
  41. static inline int elf_coredump_extra_notes_write(struct coredump_params *cprm) { return 0; }
  42. #else
  43. extern int elf_coredump_extra_notes_size(void);
  44. extern int elf_coredump_extra_notes_write(struct coredump_params *cprm);
  45. #endif
  46. #endif /* _LINUX_ELF_H */