~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/elf.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _LINUX_ELF_H
  3 #define _LINUX_ELF_H
  4 
  5 #include <linux/types.h>
  6 #include <asm/elf.h>
  7 #include <uapi/linux/elf.h>
  8 
  9 #ifndef elf_read_implies_exec
 10   /* Executables for which elf_read_implies_exec() returns TRUE will
 11      have the READ_IMPLIES_EXEC personality flag set automatically.
 12      Override in asm/elf.h as needed.  */
 13 # define elf_read_implies_exec(ex, have_pt_gnu_stack)   0
 14 #endif
 15 #ifndef SET_PERSONALITY
 16 #define SET_PERSONALITY(ex) \
 17         set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 18 #endif
 19 
 20 #ifndef SET_PERSONALITY2
 21 #define SET_PERSONALITY2(ex, state) \
 22         SET_PERSONALITY(ex)
 23 #endif
 24 
 25 #ifndef START_THREAD
 26 #define START_THREAD(elf_ex, regs, elf_entry, start_stack)      \
 27         start_thread(regs, elf_entry, start_stack)
 28 #endif
 29 
 30 #if defined(ARCH_HAS_SETUP_ADDITIONAL_PAGES) && !defined(ARCH_SETUP_ADDITIONAL_PAGES)
 31 #define ARCH_SETUP_ADDITIONAL_PAGES(bprm, ex, interpreter) \
 32         arch_setup_additional_pages(bprm, interpreter)
 33 #endif
 34 
 35 #define ELF32_GNU_PROPERTY_ALIGN        4
 36 #define ELF64_GNU_PROPERTY_ALIGN        8
 37 
 38 #if ELF_CLASS == ELFCLASS32
 39 
 40 extern Elf32_Dyn _DYNAMIC [];
 41 #define elfhdr          elf32_hdr
 42 #define elf_phdr        elf32_phdr
 43 #define elf_shdr        elf32_shdr
 44 #define elf_note        elf32_note
 45 #define elf_addr_t      Elf32_Off
 46 #define Elf_Half        Elf32_Half
 47 #define Elf_Word        Elf32_Word
 48 #define ELF_GNU_PROPERTY_ALIGN  ELF32_GNU_PROPERTY_ALIGN
 49 
 50 #else
 51 
 52 extern Elf64_Dyn _DYNAMIC [];
 53 #define elfhdr          elf64_hdr
 54 #define elf_phdr        elf64_phdr
 55 #define elf_shdr        elf64_shdr
 56 #define elf_note        elf64_note
 57 #define elf_addr_t      Elf64_Off
 58 #define Elf_Half        Elf64_Half
 59 #define Elf_Word        Elf64_Word
 60 #define ELF_GNU_PROPERTY_ALIGN  ELF64_GNU_PROPERTY_ALIGN
 61 
 62 #endif
 63 
 64 /* Optional callbacks to write extra ELF notes. */
 65 struct file;
 66 struct coredump_params;
 67 
 68 #ifndef CONFIG_ARCH_HAVE_EXTRA_ELF_NOTES
 69 static inline int elf_coredump_extra_notes_size(void) { return 0; }
 70 static inline int elf_coredump_extra_notes_write(struct coredump_params *cprm) { return 0; }
 71 #else
 72 extern int elf_coredump_extra_notes_size(void);
 73 extern int elf_coredump_extra_notes_write(struct coredump_params *cprm);
 74 #endif
 75 
 76 /*
 77  * NT_GNU_PROPERTY_TYPE_0 header:
 78  * Keep this internal until/unless there is an agreed UAPI definition.
 79  * pr_type values (GNU_PROPERTY_*) are public and defined in the UAPI header.
 80  */
 81 struct gnu_property {
 82         u32 pr_type;
 83         u32 pr_datasz;
 84 };
 85 
 86 struct arch_elf_state;
 87 
 88 #ifndef CONFIG_ARCH_USE_GNU_PROPERTY
 89 static inline int arch_parse_elf_property(u32 type, const void *data,
 90                                           size_t datasz, bool compat,
 91                                           struct arch_elf_state *arch)
 92 {
 93         return 0;
 94 }
 95 #else
 96 extern int arch_parse_elf_property(u32 type, const void *data, size_t datasz,
 97                                    bool compat, struct arch_elf_state *arch);
 98 #endif
 99 
100 #ifdef CONFIG_ARCH_HAVE_ELF_PROT
101 int arch_elf_adjust_prot(int prot, const struct arch_elf_state *state,
102                          bool has_interp, bool is_interp);
103 #else
104 static inline int arch_elf_adjust_prot(int prot,
105                                        const struct arch_elf_state *state,
106                                        bool has_interp, bool is_interp)
107 {
108         return prot;
109 }
110 #endif
111 
112 #endif /* _LINUX_ELF_H */
113 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php