Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys back out elf note changes and use EF_ARM_ABIVERS to dete...



details:   https://anonhg.NetBSD.org/src/rev/2e9e6cccc2b3
branches:  trunk
changeset: 780730:2e9e6cccc2b3
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Aug 05 01:43:58 2012 +0000

description:
back out elf note changes and use EF_ARM_ABIVERS to determine EABI usage.

diffstat:

 sys/arch/arm/arm/cpu_exec.c |   8 +++++---
 sys/kern/exec_elf.c         |  21 ++-------------------
 sys/sys/exec.h              |   4 +---
 sys/sys/exec_elf.h          |  15 +--------------
 4 files changed, 9 insertions(+), 39 deletions(-)

diffs (118 lines):

diff -r 9f42b9e4d85a -r 2e9e6cccc2b3 sys/arch/arm/arm/cpu_exec.c
--- a/sys/arch/arm/arm/cpu_exec.c       Sat Aug 04 22:31:36 2012 +0000
+++ b/sys/arch/arm/arm/cpu_exec.c       Sun Aug 05 01:43:58 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_exec.c,v 1.1 2012/08/03 07:59:22 matt Exp $        */
+/*     $NetBSD: cpu_exec.c,v 1.2 2012/08/05 01:43:59 matt Exp $        */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.1 2012/08/03 07:59:22 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.2 2012/08/05 01:43:59 matt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_netbsd32.h"
@@ -55,7 +55,9 @@
        char *itp, vaddr_t *start_p)
 {
        const char *itp_suffix = NULL;
-       const bool elf_aapcs_p = (epp->ep_flags & EXEC_ARM_AAPCS) != 0;
+       const Elf_Ehdr * const eh = eh0;
+       const bool elf_aapcs_p =
+           (eh->e_flags & EF_ARM_EABIMASK) >= EF_ARM_EABI_VER4;
 #ifdef COMPAT_NETBSD32
        const bool netbsd32_p = (epp->ep_esch->es_emul == &emul_netbsd32);
 #else
diff -r 9f42b9e4d85a -r 2e9e6cccc2b3 sys/kern/exec_elf.c
--- a/sys/kern/exec_elf.c       Sat Aug 04 22:31:36 2012 +0000
+++ b/sys/kern/exec_elf.c       Sun Aug 05 01:43:58 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_elf.c,v 1.42 2012/08/03 07:54:14 matt Exp $       */
+/*     $NetBSD: exec_elf.c,v 1.43 2012/08/05 01:43:58 matt Exp $       */
 
 /*-
  * Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.42 2012/08/03 07:54:14 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.43 2012/08/05 01:43:58 matt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pax.h"
@@ -948,23 +948,6 @@
                            sizeof(epp->ep_pax_flags));
                        break;
 
-#ifdef __arm__
-               case ELF_NOTE_TYPE_ARMEABI_TAG:
-                       if (np->n_namesz != ELF_NOTE_NETBSD_NAMESZ ||
-                           np->n_descsz != ELF_NOTE_ARMEABI_DESCSZ ||
-                           memcmp(ndata, ELF_NOTE_NETBSD_NAME,
-                           ELF_NOTE_NETBSD_NAMESZ))
-                               goto bad;
-                       {
-                               int tmp = *(int *)(ndata +
-                                   roundup(ELF_NOTE_NETBSD_NAMESZ,
-                                           sizeof(int)));
-                               if (tmp == ELF_NOTE_ARMEABI_AAPCS)
-                                       epp->ep_flags |= EXEC_ARM_AAPCS;
-                       }
-                       break;
-#endif
-
                case ELF_NOTE_TYPE_SUSE_VERSION_TAG:
                        break;
 
diff -r 9f42b9e4d85a -r 2e9e6cccc2b3 sys/sys/exec.h
--- a/sys/sys/exec.h    Sat Aug 04 22:31:36 2012 +0000
+++ b/sys/sys/exec.h    Sun Aug 05 01:43:58 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec.h,v 1.138 2012/08/03 07:54:14 matt Exp $  */
+/*     $NetBSD: exec.h,v 1.139 2012/08/05 01:43:59 matt Exp $  */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -225,8 +225,6 @@
 #define        EXEC_32         0x0020          /* 32-bit binary emulation */
 #define        EXEC_FORCEAUX   0x0040          /* always use ELF AUX vector */
 
-#define        EXEC_ARM_AAPCS  0x8000          /* ARM MD flag: uses AAPCS ABI */
-
 struct exec_vmcmd {
        int     (*ev_proc)(struct lwp *, struct exec_vmcmd *);
                                /* procedure to run for region of vmspace */
diff -r 9f42b9e4d85a -r 2e9e6cccc2b3 sys/sys/exec_elf.h
--- a/sys/sys/exec_elf.h        Sat Aug 04 22:31:36 2012 +0000
+++ b/sys/sys/exec_elf.h        Sun Aug 05 01:43:58 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_elf.h,v 1.125 2012/08/04 09:24:19 skrll Exp $     */
+/*     $NetBSD: exec_elf.h,v 1.126 2012/08/05 01:43:59 matt Exp $      */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -895,19 +895,6 @@
 #define ELF_NOTE_PAX_DESCSZ            4
 
 /*
- * NetBSD-specific note type: aeabi.
- * There should be 1 NOTE per executable.
- * name: NetBSD\0
- * namesz: 6
- * desc:
- *     word[0]: ABI bitmask
- * descsz: 4
- */
-#define        ELF_NOTE_TYPE_ARMEABI_TAG       4
-#define        ELF_NOTE_ARMEABI_DESCSZ         4
-#define        ELF_NOTE_ARMEABI_AAPCS          0x01
-
-/*
  * NetBSD-specific core file information.
  *
  * NetBSD ELF core files use notes to provide information about



Home | Main Index | Thread Index | Old Index