2005-04-16 15:20:36 -07:00
|
|
|
#ifndef _LINUX_ELF_H
|
|
|
|
|
#define _LINUX_ELF_H
|
|
|
|
|
|
|
|
|
|
#include <asm/elf.h>
|
2012-10-13 10:46:48 +01:00
|
|
|
#include <uapi/linux/elf.h>
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-12-12 13:54:36 +00:00
|
|
|
#ifndef elf_read_implies_exec
|
|
|
|
|
/* Executables for which elf_read_implies_exec() returns TRUE will
|
|
|
|
|
have the READ_IMPLIES_EXEC personality flag set automatically.
|
|
|
|
|
Override in asm/elf.h as needed. */
|
|
|
|
|
# define elf_read_implies_exec(ex, have_pt_gnu_stack) 0
|
|
|
|
|
#endif
|
2013-02-17 17:47:04 -05:00
|
|
|
#ifndef SET_PERSONALITY
|
|
|
|
|
#define SET_PERSONALITY(ex) \
|
|
|
|
|
set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
|
|
|
|
|
#endif
|
2011-12-12 13:54:36 +00:00
|
|
|
|
2014-09-11 08:30:16 +01:00
|
|
|
#ifndef SET_PERSONALITY2
|
|
|
|
|
#define SET_PERSONALITY2(ex, state) \
|
|
|
|
|
SET_PERSONALITY(ex)
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
#if ELF_CLASS == ELFCLASS32
|
|
|
|
|
|
|
|
|
|
extern Elf32_Dyn _DYNAMIC [];
|
|
|
|
|
#define elfhdr elf32_hdr
|
|
|
|
|
#define elf_phdr elf32_phdr
|
2010-03-05 13:44:10 -08:00
|
|
|
#define elf_shdr elf32_shdr
|
2005-04-16 15:20:36 -07:00
|
|
|
#define elf_note elf32_note
|
2006-12-06 20:37:53 -08:00
|
|
|
#define elf_addr_t Elf32_Off
|
2010-03-05 13:44:07 -08:00
|
|
|
#define Elf_Half Elf32_Half
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
extern Elf64_Dyn _DYNAMIC [];
|
|
|
|
|
#define elfhdr elf64_hdr
|
|
|
|
|
#define elf_phdr elf64_phdr
|
2010-03-05 13:44:10 -08:00
|
|
|
#define elf_shdr elf64_shdr
|
2005-04-16 15:20:36 -07:00
|
|
|
#define elf_note elf64_note
|
2006-12-06 20:37:53 -08:00
|
|
|
#define elf_addr_t Elf64_Off
|
2010-03-05 13:44:07 -08:00
|
|
|
#define Elf_Half Elf64_Half
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2007-09-19 14:38:12 +10:00
|
|
|
/* Optional callbacks to write extra ELF notes. */
|
2011-12-12 13:54:36 +00:00
|
|
|
struct file;
|
2013-10-05 22:24:29 -04:00
|
|
|
struct coredump_params;
|
2011-12-12 13:54:36 +00:00
|
|
|
|
2006-11-23 00:46:37 +01:00
|
|
|
#ifndef ARCH_HAVE_EXTRA_ELF_NOTES
|
2007-09-19 14:38:12 +10:00
|
|
|
static inline int elf_coredump_extra_notes_size(void) { return 0; }
|
2013-10-05 22:24:29 -04:00
|
|
|
static inline int elf_coredump_extra_notes_write(struct coredump_params *cprm) { return 0; }
|
2007-09-19 14:38:12 +10:00
|
|
|
#else
|
|
|
|
|
extern int elf_coredump_extra_notes_size(void);
|
2013-10-05 22:24:29 -04:00
|
|
|
extern int elf_coredump_extra_notes_write(struct coredump_params *cprm);
|
2007-09-19 14:38:12 +10:00
|
|
|
#endif
|
2005-04-16 15:20:36 -07:00
|
|
|
#endif /* _LINUX_ELF_H */
|