Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
elf.h File Reference
#include <linux/thread_info.h>
#include <asm/ptrace.h>
#include <asm/user.h>
#include <asm/auxvec.h>
#include <asm/vdso.h>
#include <asm/processor.h>

Go to the source code of this file.

Data Structures

struct  va_alignment
 

Macros

#define ELF_NGREG   (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
 
#define R_X86_64_NONE   0 /* No reloc */
 
#define R_X86_64_64   1 /* Direct 64 bit */
 
#define R_X86_64_PC32   2 /* PC relative 32 bit signed */
 
#define R_X86_64_GOT32   3 /* 32 bit GOT entry */
 
#define R_X86_64_PLT32   4 /* 32 bit PLT address */
 
#define R_X86_64_COPY   5 /* Copy symbol at runtime */
 
#define R_X86_64_GLOB_DAT   6 /* Create GOT entry */
 
#define R_X86_64_JUMP_SLOT   7 /* Create PLT entry */
 
#define R_X86_64_RELATIVE   8 /* Adjust by program base */
 
#define R_X86_64_GOTPCREL
 
#define R_X86_64_32   10 /* Direct 32 bit zero extended */
 
#define R_X86_64_32S   11 /* Direct 32 bit sign extended */
 
#define R_X86_64_16   12 /* Direct 16 bit zero extended */
 
#define R_X86_64_PC16   13 /* 16 bit sign extended pc relative */
 
#define R_X86_64_8   14 /* Direct 8 bit sign extended */
 
#define R_X86_64_PC8   15 /* 8 bit sign extended pc relative */
 
#define R_X86_64_NUM   16
 
#define ELF_CLASS   ELFCLASS64
 
#define ELF_DATA   ELFDATA2LSB
 
#define ELF_ARCH   EM_X86_64
 
#define elf_check_arch_ia32(x)   (((x)->e_machine == EM_386) || ((x)->e_machine == EM_486))
 
#define elf_check_arch(x)   ((x)->e_machine == EM_X86_64)
 
#define compat_elf_check_arch(x)   (elf_check_arch_ia32(x) || (x)->e_machine == EM_X86_64)
 
#define ELF_PLAT_INIT(_r, load_addr)   elf_common_init(&current->thread, _r, 0)
 
#define COMPAT_ELF_PLAT_INIT(regs, load_addr)   elf_common_init(&current->thread, regs, __USER_DS)
 
#define compat_start_thread   start_thread_ia32
 
#define COMPAT_SET_PERSONALITY(ex)   set_personality_ia32((ex).e_machine == EM_X86_64)
 
#define COMPAT_ELF_PLATFORM   ("i686")
 
#define ELF_CORE_COPY_REGS(pr_reg, regs)
 
#define ELF_PLATFORM   ("x86_64")
 
#define CORE_DUMP_USE_REGSET
 
#define ELF_EXEC_PAGESIZE   4096
 
#define ELF_ET_DYN_BASE   (TASK_SIZE / 3 * 2)
 
#define ELF_HWCAP   (boot_cpu_data.x86_capability[0])
 
#define SET_PERSONALITY(ex)   set_personality_64bit()
 
#define elf_read_implies_exec(ex, executable_stack)   (executable_stack != EXSTACK_DISABLE_X)
 
#define ARCH_DLINFO_IA32(vdso_enabled)
 
#define VDSO_HIGH_BASE   0xffffe000U /* CONFIG_COMPAT_VDSO address */
 
#define STACK_RND_MASK   (test_thread_flag(TIF_ADDR32) ? 0x7ff : 0x3fffff)
 
#define ARCH_DLINFO
 
#define ARCH_DLINFO_X32
 
#define AT_SYSINFO   32
 
#define COMPAT_ARCH_DLINFO
 
#define COMPAT_ELF_ET_DYN_BASE   (TASK_UNMAPPED_BASE + 0x1000000)
 
#define VDSO_CURRENT_BASE   ((unsigned long)current->mm->context.vdso)
 
#define VDSO_ENTRY   ((unsigned long)VDSO32_SYMBOL(VDSO_CURRENT_BASE, vsyscall))
 
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES   1
 
#define compat_arch_setup_additional_pages   syscall32_setup_pages
 
#define arch_randomize_brk   arch_randomize_brk
 

Typedefs

typedef unsigned long elf_greg_t
 
typedef elf_greg_t elf_gregset_t [ELF_NGREG]
 
typedef struct user_i387_struct elf_fpregset_t
 

Enumerations

enum  align_flags { ALIGN_VA_32 = BIT(0), ALIGN_VA_64 = BIT(1), ALIGN_VDSO = BIT(2), ALIGN_TOPDOWN = BIT(3) }
 

Functions

void start_thread_ia32 (struct pt_regs *regs, u32 new_ip, u32 new_sp)
 
void set_personality_ia32 (bool)
 
void set_personality_64bit (void)
 
int arch_setup_additional_pages (struct linux_binprm *bprm, int uses_interp)
 
int x32_setup_additional_pages (struct linux_binprm *bprm, int uses_interp)
 
int syscall32_setup_pages (struct linux_binprm *, int exstack)
 
unsigned long arch_randomize_brk (struct mm_struct *mm)
 
unsigned long align_addr (unsigned long, struct file *, enum align_flags)
 

Variables

unsigned int vdso_enabled
 
unsigned int sysctl_vsyscall32
 
int force_personality32
 
struct va_alignment ____cacheline_aligned
 
struct va_alignment va_align
 

Macro Definition Documentation

#define ARCH_DLINFO
Value:
do { \
if (vdso_enabled) \
NEW_AUX_ENT(AT_SYSINFO_EHDR, \
(unsigned long)current->mm->context.vdso); \
} while (0)

Definition at line 296 of file elf.h.

#define ARCH_DLINFO_IA32 (   vdso_enabled)
Value:
do { \
if (vdso_enabled) { \
NEW_AUX_ENT(AT_SYSINFO, VDSO_ENTRY); \
} \
} while (0)

Definition at line 271 of file elf.h.

#define ARCH_DLINFO_X32
Value:
do { \
if (vdso_enabled) \
NEW_AUX_ENT(AT_SYSINFO_EHDR, \
(unsigned long)current->mm->context.vdso); \
} while (0)

Definition at line 303 of file elf.h.

#define ARCH_HAS_SETUP_ADDITIONAL_PAGES   1

Definition at line 329 of file elf.h.

#define arch_randomize_brk   arch_randomize_brk

Definition at line 339 of file elf.h.

#define AT_SYSINFO   32

Definition at line 310 of file elf.h.

#define COMPAT_ARCH_DLINFO
Value:
if (test_thread_flag(TIF_X32)) \
ARCH_DLINFO_X32; \
ARCH_DLINFO_IA32(sysctl_vsyscall32)

Definition at line 312 of file elf.h.

#define compat_arch_setup_additional_pages   syscall32_setup_pages

Definition at line 336 of file elf.h.

#define compat_elf_check_arch (   x)    (elf_check_arch_ia32(x) || (x)->e_machine == EM_X86_64)

Definition at line 157 of file elf.h.

#define COMPAT_ELF_ET_DYN_BASE   (TASK_UNMAPPED_BASE + 0x1000000)

Definition at line 318 of file elf.h.

#define COMPAT_ELF_PLAT_INIT (   regs,
  load_addr 
)    elf_common_init(&current->thread, regs, __USER_DS)

Definition at line 179 of file elf.h.

#define COMPAT_ELF_PLATFORM   ("i686")

Definition at line 189 of file elf.h.

#define COMPAT_SET_PERSONALITY (   ex)    set_personality_ia32((ex).e_machine == EM_X86_64)

Definition at line 186 of file elf.h.

#define compat_start_thread   start_thread_ia32

Definition at line 183 of file elf.h.

#define CORE_DUMP_USE_REGSET

Definition at line 237 of file elf.h.

#define ELF_ARCH   EM_X86_64

Definition at line 71 of file elf.h.

#define elf_check_arch (   x)    ((x)->e_machine == EM_X86_64)

Definition at line 154 of file elf.h.

#define elf_check_arch_ia32 (   x)    (((x)->e_machine == EM_386) || ((x)->e_machine == EM_486))

Definition at line 82 of file elf.h.

#define ELF_CLASS   ELFCLASS64

Definition at line 69 of file elf.h.

#define ELF_CORE_COPY_REGS (   pr_reg,
  regs 
)
Value:
do { \
unsigned v; \
(pr_reg)[0] = (regs)->r15; \
(pr_reg)[1] = (regs)->r14; \
(pr_reg)[2] = (regs)->r13; \
(pr_reg)[3] = (regs)->r12; \
(pr_reg)[4] = (regs)->bp; \
(pr_reg)[5] = (regs)->bx; \
(pr_reg)[6] = (regs)->r11; \
(pr_reg)[7] = (regs)->r10; \
(pr_reg)[8] = (regs)->r9; \
(pr_reg)[9] = (regs)->r8; \
(pr_reg)[10] = (regs)->ax; \
(pr_reg)[11] = (regs)->cx; \
(pr_reg)[12] = (regs)->dx; \
(pr_reg)[13] = (regs)->si; \
(pr_reg)[14] = (regs)->di; \
(pr_reg)[15] = (regs)->orig_ax; \
(pr_reg)[16] = (regs)->ip; \
(pr_reg)[17] = (regs)->cs; \
(pr_reg)[18] = (regs)->flags; \
(pr_reg)[19] = (regs)->sp; \
(pr_reg)[20] = (regs)->ss; \
(pr_reg)[21] = current->thread.fs; \
(pr_reg)[22] = current->thread.gs; \
asm("movl %%ds,%0" : "=r" (v)); (pr_reg)[23] = v; \
asm("movl %%es,%0" : "=r" (v)); (pr_reg)[24] = v; \
asm("movl %%fs,%0" : "=r" (v)); (pr_reg)[25] = v; \
asm("movl %%gs,%0" : "=r" (v)); (pr_reg)[26] = v; \
} while (0);

Definition at line 197 of file elf.h.

#define ELF_DATA   ELFDATA2LSB

Definition at line 70 of file elf.h.

#define ELF_ET_DYN_BASE   (TASK_SIZE / 3 * 2)

Definition at line 245 of file elf.h.

#define ELF_EXEC_PAGESIZE   4096

Definition at line 238 of file elf.h.

#define ELF_HWCAP   (boot_cpu_data.x86_capability[0])

Definition at line 251 of file elf.h.

#define ELF_NGREG   (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))

Definition at line 15 of file elf.h.

#define ELF_PLAT_INIT (   _r,
  load_addr 
)    elf_common_init(&current->thread, _r, 0)

Definition at line 176 of file elf.h.

#define ELF_PLATFORM   ("x86_64")

Definition at line 230 of file elf.h.

#define elf_read_implies_exec (   ex,
  executable_stack 
)    (executable_stack != EXSTACK_DISABLE_X)

Definition at line 266 of file elf.h.

#define R_X86_64_16   12 /* Direct 16 bit zero extended */

Definition at line 59 of file elf.h.

#define R_X86_64_32   10 /* Direct 32 bit zero extended */

Definition at line 57 of file elf.h.

#define R_X86_64_32S   11 /* Direct 32 bit sign extended */

Definition at line 58 of file elf.h.

#define R_X86_64_64   1 /* Direct 64 bit */

Definition at line 48 of file elf.h.

#define R_X86_64_8   14 /* Direct 8 bit sign extended */

Definition at line 61 of file elf.h.

#define R_X86_64_COPY   5 /* Copy symbol at runtime */

Definition at line 52 of file elf.h.

#define R_X86_64_GLOB_DAT   6 /* Create GOT entry */

Definition at line 53 of file elf.h.

#define R_X86_64_GOT32   3 /* 32 bit GOT entry */

Definition at line 50 of file elf.h.

#define R_X86_64_GOTPCREL
Value:
9 /* 32 bit signed pc relative
offset to GOT */

Definition at line 56 of file elf.h.

#define R_X86_64_JUMP_SLOT   7 /* Create PLT entry */

Definition at line 54 of file elf.h.

#define R_X86_64_NONE   0 /* No reloc */

Definition at line 47 of file elf.h.

#define R_X86_64_NUM   16

Definition at line 64 of file elf.h.

#define R_X86_64_PC16   13 /* 16 bit sign extended pc relative */

Definition at line 60 of file elf.h.

#define R_X86_64_PC32   2 /* PC relative 32 bit signed */

Definition at line 49 of file elf.h.

#define R_X86_64_PC8   15 /* 8 bit sign extended pc relative */

Definition at line 62 of file elf.h.

#define R_X86_64_PLT32   4 /* 32 bit PLT address */

Definition at line 51 of file elf.h.

#define R_X86_64_RELATIVE   8 /* Adjust by program base */

Definition at line 55 of file elf.h.

#define SET_PERSONALITY (   ex)    set_personality_64bit()

Definition at line 260 of file elf.h.

#define STACK_RND_MASK   (test_thread_flag(TIF_ADDR32) ? 0x7ff : 0x3fffff)

Definition at line 294 of file elf.h.

#define VDSO_CURRENT_BASE   ((unsigned long)current->mm->context.vdso)

Definition at line 322 of file elf.h.

#define VDSO_ENTRY   ((unsigned long)VDSO32_SYMBOL(VDSO_CURRENT_BASE, vsyscall))

Definition at line 324 of file elf.h.

#define VDSO_HIGH_BASE   0xffffe000U /* CONFIG_COMPAT_VDSO address */

Definition at line 291 of file elf.h.

Typedef Documentation

Definition at line 18 of file elf.h.

typedef unsigned long elf_greg_t

Definition at line 13 of file elf.h.

Definition at line 16 of file elf.h.

Enumeration Type Documentation

Enumerator:
ALIGN_VA_32 
ALIGN_VA_64 
ALIGN_VDSO 
ALIGN_TOPDOWN 

Definition at line 357 of file elf.h.

Function Documentation

unsigned long align_addr ( unsigned  long,
struct file ,
enum  align_flags 
)

Definition at line 28 of file sys_x86_64.c.

unsigned long arch_randomize_brk ( struct mm_struct mm)

Definition at line 454 of file process.c.

int arch_setup_additional_pages ( struct linux_binprm bprm,
int  uses_interp 
)

Definition at line 152 of file vdso.c.

void set_personality_64bit ( void  )

Definition at line 374 of file process_64.c.

void set_personality_ia32 ( bool  )

Definition at line 394 of file process_64.c.

void start_thread_ia32 ( struct pt_regs regs,
u32  new_ip,
u32  new_sp 
)
int syscall32_setup_pages ( struct linux_binprm ,
int  exstack 
)
int x32_setup_additional_pages ( struct linux_binprm bprm,
int  uses_interp 
)

Variable Documentation

int force_personality32

Definition at line 80 of file init_64.c.

unsigned int sysctl_vsyscall32
struct va_alignment va_align

Definition at line 34 of file mmap.c.

unsigned int vdso_enabled

Definition at line 53 of file vdso.c.