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

This commit is contained in:
matt 2012-08-05 01:43:58 +00:00
parent 12da95356e
commit 3e95365cba
4 changed files with 9 additions and 39 deletions

View File

@ -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 @@ arm_netbsd_elf32_probe(struct lwp *l, struct exec_package *epp, void *eh0,
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

View File

@ -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 @@ bad:
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;

View File

@ -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 @@ struct exec_package {
#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 */

View File

@ -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.
@ -894,19 +894,6 @@ typedef struct {
#define ELF_NOTE_PAX_NAME "PaX\0"
#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.
*