aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/cputable.h1
-rw-r--r--arch/powerpc/include/asm/elf.h1
-rw-r--r--fs/binfmt_elf.c3
-rw-r--r--fs/binfmt_elf_fdpic.c8
-rw-r--r--include/uapi/linux/auxvec.h1
5 files changed, 10 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index fb3245e928ea..ccadad6db4e4 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -52,6 +52,7 @@ struct cpu_spec {
52 char *cpu_name; 52 char *cpu_name;
53 unsigned long cpu_features; /* Kernel features */ 53 unsigned long cpu_features; /* Kernel features */
54 unsigned int cpu_user_features; /* Userland features */ 54 unsigned int cpu_user_features; /* Userland features */
55 unsigned int cpu_user_features2; /* Userland features v2 */
55 unsigned int mmu_features; /* MMU features */ 56 unsigned int mmu_features; /* MMU features */
56 57
57 /* cache line sizes */ 58 /* cache line sizes */
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
index ac9790fc3836..cc0655a702a7 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
@@ -61,6 +61,7 @@ typedef elf_vrregset_t elf_fpxregset_t;
61 instruction set this cpu supports. This could be done in userspace, 61 instruction set this cpu supports. This could be done in userspace,
62 but it's not easy, and we've already done it here. */ 62 but it's not easy, and we've already done it here. */
63# define ELF_HWCAP (cur_cpu_spec->cpu_user_features) 63# define ELF_HWCAP (cur_cpu_spec->cpu_user_features)
64# define ELF_HWCAP2 (cur_cpu_spec->cpu_user_features2)
64 65
65/* This yields a string that ld.so will use to load implementation 66/* This yields a string that ld.so will use to load implementation
66 specific libraries for optimization. This is more specific in 67 specific libraries for optimization. This is more specific in
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 86af964c2425..f1c64a27257e 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -240,6 +240,9 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
240 NEW_AUX_ENT(AT_EGID, from_kgid_munged(cred->user_ns, cred->egid)); 240 NEW_AUX_ENT(AT_EGID, from_kgid_munged(cred->user_ns, cred->egid));
241 NEW_AUX_ENT(AT_SECURE, security_bprm_secureexec(bprm)); 241 NEW_AUX_ENT(AT_SECURE, security_bprm_secureexec(bprm));
242 NEW_AUX_ENT(AT_RANDOM, (elf_addr_t)(unsigned long)u_rand_bytes); 242 NEW_AUX_ENT(AT_RANDOM, (elf_addr_t)(unsigned long)u_rand_bytes);
243#ifdef ELF_HWCAP2
244 NEW_AUX_ENT(AT_HWCAP2, ELF_HWCAP2);
245#endif
243 NEW_AUX_ENT(AT_EXECFN, bprm->exec); 246 NEW_AUX_ENT(AT_EXECFN, bprm->exec);
244 if (k_platform) { 247 if (k_platform) {
245 NEW_AUX_ENT(AT_PLATFORM, 248 NEW_AUX_ENT(AT_PLATFORM,
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index 9c13e023e2b7..bf2381d00132 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -483,7 +483,6 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
483 size_t platform_len = 0, len; 483 size_t platform_len = 0, len;
484 char *k_platform, *k_base_platform; 484 char *k_platform, *k_base_platform;
485 char __user *u_platform, *u_base_platform, *p; 485 char __user *u_platform, *u_base_platform, *p;
486 long hwcap;
487 int loop; 486 int loop;
488 int nr; /* reset for each csp adjustment */ 487 int nr; /* reset for each csp adjustment */
489 488
@@ -502,8 +501,6 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
502 return -EFAULT; 501 return -EFAULT;
503#endif 502#endif
504 503
505 hwcap = ELF_HWCAP;
506
507 /* 504 /*
508 * If this architecture has a platform capability string, copy it 505 * If this architecture has a platform capability string, copy it
509 * to userspace. In some cases (Sparc), this info is impossible 506 * to userspace. In some cases (Sparc), this info is impossible
@@ -617,7 +614,10 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm,
617 614
618 nr = 0; 615 nr = 0;
619 csp -= DLINFO_ITEMS * 2 * sizeof(unsigned long); 616 csp -= DLINFO_ITEMS * 2 * sizeof(unsigned long);
620 NEW_AUX_ENT(AT_HWCAP, hwcap); 617 NEW_AUX_ENT(AT_HWCAP, ELF_HWCAP);
618#ifdef ELF_HWCAP2
619 NEW_AUX_ENT(AT_HWCAP2, ELF_HWCAP2);
620#endif
621 NEW_AUX_ENT(AT_PAGESZ, PAGE_SIZE); 621 NEW_AUX_ENT(AT_PAGESZ, PAGE_SIZE);
622 NEW_AUX_ENT(AT_CLKTCK, CLOCKS_PER_SEC); 622 NEW_AUX_ENT(AT_CLKTCK, CLOCKS_PER_SEC);
623 NEW_AUX_ENT(AT_PHDR, exec_params->ph_addr); 623 NEW_AUX_ENT(AT_PHDR, exec_params->ph_addr);
diff --git a/include/uapi/linux/auxvec.h b/include/uapi/linux/auxvec.h
index 61594d598e7b..835c065cc7e1 100644
--- a/include/uapi/linux/auxvec.h
+++ b/include/uapi/linux/auxvec.h
@@ -28,6 +28,7 @@
28#define AT_BASE_PLATFORM 24 /* string identifying real platform, may 28#define AT_BASE_PLATFORM 24 /* string identifying real platform, may
29 * differ from AT_PLATFORM. */ 29 * differ from AT_PLATFORM. */
30#define AT_RANDOM 25 /* address of 16 random bytes */ 30#define AT_RANDOM 25 /* address of 16 random bytes */
31#define AT_HWCAP2 26 /* extension of AT_HWCAP */
31 32
32#define AT_EXECFN 31 /* filename of program */ 33#define AT_EXECFN 31 /* filename of program */
33 34