diff options
Diffstat (limited to 'arch/s390/include/asm/elf.h')
| -rw-r--r-- | arch/s390/include/asm/elf.h | 59 | 
1 files changed, 34 insertions, 25 deletions
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h index 354d42616c7..78f4f8711d5 100644 --- a/arch/s390/include/asm/elf.h +++ b/arch/s390/include/asm/elf.h @@ -1,6 +1,4 @@  /* - *  include/asm-s390/elf.h - *   *  S390 version   *   *  Derived from "include/asm-i386/elf.h" @@ -103,15 +101,16 @@  #define HWCAP_S390_HPAGE	128  #define HWCAP_S390_ETF3EH	256  #define HWCAP_S390_HIGH_GPRS	512 +#define HWCAP_S390_TE		1024  /*   * These are used to set parameters in the core dumps.   */ -#ifndef __s390x__ +#ifndef CONFIG_64BIT  #define ELF_CLASS	ELFCLASS32 -#else /* __s390x__ */ +#else /* CONFIG_64BIT */  #define ELF_CLASS	ELFCLASS64 -#endif /* __s390x__ */ +#endif /* CONFIG_64BIT */  #define ELF_DATA	ELFDATA2MSB  #define ELF_ARCH	EM_S390 @@ -120,6 +119,8 @@   */  #include <asm/ptrace.h> +#include <asm/compat.h> +#include <asm/syscall.h>  #include <asm/user.h>  typedef s390_fp_regs elf_fpregset_t; @@ -129,7 +130,6 @@ typedef s390_fp_regs compat_elf_fpregset_t;  typedef s390_compat_regs compat_elf_gregset_t;  #include <linux/sched.h>	/* for task_struct */ -#include <asm/system.h>		/* for save_access_regs */  #include <asm/mmu_context.h>  #include <asm/vdso.h> @@ -161,7 +161,9 @@ extern unsigned int vdso_enabled;     use of this is to invoke "./ld.so someprog" to test out a new version of     the loader.  We need to make sure that it is out of the way of the program     that it will "exec", and that there is sufficient room for the brk.  */ -#define ELF_ET_DYN_BASE		(STACK_TOP / 3 * 2) + +extern unsigned long randomize_et_dyn(unsigned long base); +#define ELF_ET_DYN_BASE		(randomize_et_dyn(STACK_TOP / 3 * 2))  /* This yields a mask that user programs can use to figure out what     instruction set this CPU supports. */ @@ -180,31 +182,33 @@ extern unsigned long elf_hwcap;  extern char elf_platform[];  #define ELF_PLATFORM (elf_platform) -#ifndef __s390x__ -#define SET_PERSONALITY(ex) set_personality(PER_LINUX) -#else /* __s390x__ */ +#ifndef CONFIG_COMPAT +#define SET_PERSONALITY(ex) \ +do {								\ +	set_personality(PER_LINUX |				\ +		(current->personality & (~PER_MASK)));		\ +	current_thread_info()->sys_call_table = 		\ +		(unsigned long) &sys_call_table;		\ +} while (0) +#else /* CONFIG_COMPAT */  #define SET_PERSONALITY(ex)					\  do {								\  	if (personality(current->personality) != PER_LINUX32)	\ -		set_personality(PER_LINUX);			\ -	if ((ex).e_ident[EI_CLASS] == ELFCLASS32)		\ +		set_personality(PER_LINUX |			\ +			(current->personality & ~PER_MASK));	\ +	if ((ex).e_ident[EI_CLASS] == ELFCLASS32) {		\  		set_thread_flag(TIF_31BIT);			\ -	else							\ +		current_thread_info()->sys_call_table =		\ +			(unsigned long)	&sys_call_table_emu;	\ +	} else {						\  		clear_thread_flag(TIF_31BIT);			\ +		current_thread_info()->sys_call_table =		\ +			(unsigned long) &sys_call_table;	\ +	}							\  } while (0) -#endif /* __s390x__ */ +#endif /* CONFIG_COMPAT */ -/* - * An executable for which elf_read_implies_exec() returns TRUE will - * have the READ_IMPLIES_EXEC personality flag set automatically. - */ -#define elf_read_implies_exec(ex, executable_stack)	\ -({							\ -	if (current->mm->context.noexec &&		\ -	    executable_stack != EXSTACK_DISABLE_X)	\ -		disable_noexec(current->mm, current);	\ -	current->mm->context.noexec == 0;		\ -}) +#define STACK_RND_MASK	0x7ffUL  #define ARCH_DLINFO							    \  do {									    \ @@ -218,4 +222,9 @@ struct linux_binprm;  #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1  int arch_setup_additional_pages(struct linux_binprm *, int); +extern unsigned long arch_randomize_brk(struct mm_struct *mm); +#define arch_randomize_brk arch_randomize_brk + +void *fill_cpu_elf_notes(void *ptr, struct save_area *sa); +  #endif  | 
