mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	default SET_PERSONALITY() in linux/elf.h
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
		
							parent
							
								
									79f9f99ad1
								
							
						
					
					
						commit
						e72837e3e7
					
				
					 17 changed files with 5 additions and 54 deletions
				
			
		| 
						 | 
					@ -102,7 +102,4 @@ typedef struct user_fpu_struct elf_fpregset_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ELF_PLATFORM  (NULL)
 | 
					#define ELF_PLATFORM  (NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX_32BIT | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif /* __ASM_AVR32_ELF_H */
 | 
					#endif /* __ASM_AVR32_ELF_H */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -132,7 +132,4 @@ do {											\
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ELF_PLATFORM  (NULL)
 | 
					#define ELF_PLATFORM  (NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,9 +77,6 @@ do {								\
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ELF_PLATFORM  (NULL)
 | 
					#define ELF_PLATFORM  (NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/* C6X specific section types */
 | 
					/* C6X specific section types */
 | 
				
			||||||
#define SHT_C6000_UNWIND	0x70000001
 | 
					#define SHT_C6000_UNWIND	0x70000001
 | 
				
			||||||
#define SHT_C6000_PREEMPTMAP	0x70000002
 | 
					#define SHT_C6000_PREEMPTMAP	0x70000002
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -86,7 +86,4 @@ typedef unsigned long elf_fpregset_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ELF_PLATFORM  (NULL)
 | 
					#define ELF_PLATFORM  (NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -137,7 +137,4 @@ do {											\
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ELF_PLATFORM  (NULL)
 | 
					#define ELF_PLATFORM  (NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,9 +54,6 @@ typedef unsigned long elf_fpregset_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ELF_PLATFORM  (NULL)
 | 
					#define ELF_PLATFORM  (NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define R_H8_NONE       0
 | 
					#define R_H8_NONE       0
 | 
				
			||||||
#define R_H8_DIR32      1
 | 
					#define R_H8_DIR32      1
 | 
				
			||||||
#define R_H8_DIR32_28   2
 | 
					#define R_H8_DIR32_28   2
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -216,11 +216,6 @@ do {					\
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
#define ELF_PLATFORM  (NULL)
 | 
					#define ELF_PLATFORM  (NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __KERNEL__
 | 
					 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
 | 
					#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
 | 
				
			||||||
struct linux_binprm;
 | 
					struct linux_binprm;
 | 
				
			||||||
extern int arch_setup_additional_pages(struct linux_binprm *bprm,
 | 
					extern int arch_setup_additional_pages(struct linux_binprm *bprm,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -201,9 +201,6 @@ extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst);
 | 
				
			||||||
   relevant until we have real hardware to play with... */
 | 
					   relevant until we have real hardware to play with... */
 | 
				
			||||||
#define ELF_PLATFORM	NULL
 | 
					#define ELF_PLATFORM	NULL
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SET_PERSONALITY(ex)	\
 | 
					 | 
				
			||||||
	set_personality((current->personality & ~PER_MASK) | PER_LINUX)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define elf_read_implies_exec(ex, executable_stack)					\
 | 
					#define elf_read_implies_exec(ex, executable_stack)					\
 | 
				
			||||||
	((executable_stack!=EXSTACK_DISABLE_X) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)
 | 
						((executable_stack!=EXSTACK_DISABLE_X) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -128,7 +128,4 @@ typedef elf_fpreg_t elf_fpregset_t;
 | 
				
			||||||
   intent than poking at uname or /proc/cpuinfo.  */
 | 
					   intent than poking at uname or /proc/cpuinfo.  */
 | 
				
			||||||
#define ELF_PLATFORM	(NULL)
 | 
					#define ELF_PLATFORM	(NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif  /* _ASM_M32R__ELF_H */
 | 
					#endif  /* _ASM_M32R__ELF_H */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -113,7 +113,4 @@ typedef struct user_m68kfp_struct elf_fpregset_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ELF_PLATFORM  (NULL)
 | 
					#define ELF_PLATFORM  (NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -150,9 +150,4 @@ do {						\
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
#define ELF_PLATFORM  (NULL)
 | 
					#define ELF_PLATFORM  (NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __KERNEL__
 | 
					 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif /* _ASM_ELF_H */
 | 
					#endif /* _ASM_ELF_H */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -62,7 +62,4 @@ extern void dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ELF_PLATFORM	(NULL)
 | 
					#define ELF_PLATFORM	(NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -103,8 +103,6 @@ do {								\
 | 
				
			||||||
# define elf_read_implies_exec(ex, exec_stk) (is_32bit_task() ? \
 | 
					# define elf_read_implies_exec(ex, exec_stk) (is_32bit_task() ? \
 | 
				
			||||||
		(exec_stk == EXSTACK_DEFAULT) : 0)
 | 
							(exec_stk == EXSTACK_DEFAULT) : 0)
 | 
				
			||||||
#else 
 | 
					#else 
 | 
				
			||||||
# define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
  set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
# define elf_read_implies_exec(ex, exec_stk) (exec_stk == EXSTACK_DEFAULT)
 | 
					# define elf_read_implies_exec(ex, exec_stk) (exec_stk == EXSTACK_DEFAULT)
 | 
				
			||||||
#endif /* __powerpc64__ */
 | 
					#endif /* __powerpc64__ */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -180,10 +180,7 @@ extern unsigned long elf_hwcap;
 | 
				
			||||||
extern char elf_platform[];
 | 
					extern char elf_platform[];
 | 
				
			||||||
#define ELF_PLATFORM (elf_platform)
 | 
					#define ELF_PLATFORM (elf_platform)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifndef CONFIG_64BIT
 | 
					#ifdef CONFIG_64BIT
 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
#else /* CONFIG_64BIT */
 | 
					 | 
				
			||||||
#define SET_PERSONALITY(ex)					\
 | 
					#define SET_PERSONALITY(ex)					\
 | 
				
			||||||
do {								\
 | 
					do {								\
 | 
				
			||||||
	if (personality(current->personality) != PER_LINUX32)	\
 | 
						if (personality(current->personality) != PER_LINUX32)	\
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -52,11 +52,6 @@ typedef elf_fpreg_t	elf_fpregset_t;
 | 
				
			||||||
#define ELF_DATA	ELFDATA2LSB
 | 
					#define ELF_DATA	ELFDATA2LSB
 | 
				
			||||||
#define ELF_ARCH	EM_SCORE7
 | 
					#define ELF_ARCH	EM_SCORE7
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SET_PERSONALITY(ex)					\
 | 
					 | 
				
			||||||
do {								\
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK))); \
 | 
					 | 
				
			||||||
} while (0)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
struct task_struct;
 | 
					struct task_struct;
 | 
				
			||||||
struct pt_regs;
 | 
					struct pt_regs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -128,7 +128,4 @@ typedef struct {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define ELF_PLATFORM	(NULL)
 | 
					#define ELF_PLATFORM	(NULL)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SET_PERSONALITY(ex) \
 | 
					 | 
				
			||||||
	set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#endif /* !(__ASMSPARC_ELF_H) */
 | 
					#endif /* !(__ASMSPARC_ELF_H) */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,6 +10,10 @@
 | 
				
			||||||
     Override in asm/elf.h as needed.  */
 | 
					     Override in asm/elf.h as needed.  */
 | 
				
			||||||
# define elf_read_implies_exec(ex, have_pt_gnu_stack)	0
 | 
					# define elf_read_implies_exec(ex, have_pt_gnu_stack)	0
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					#ifndef SET_PERSONALITY
 | 
				
			||||||
 | 
					#define SET_PERSONALITY(ex) \
 | 
				
			||||||
 | 
						set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if ELF_CLASS == ELFCLASS32
 | 
					#if ELF_CLASS == ELFCLASS32
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue