Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Cleanup and clarify the ELFSIZE mess:
details: https://anonhg.NetBSD.org/src/rev/7f20341c72a2
branches: trunk
changeset: 357328:7f20341c72a2
user: christos <christos%NetBSD.org@localhost>
date: Mon Nov 06 03:47:45 2017 +0000
description:
Cleanup and clarify the ELFSIZE mess:
We now have 2 variables automatically set in elf_machdep.h:
ARCH_ELFSIZE: the size for userland binaries
KERN_ELFSIZE: the size for the kernel binaries
DB_ELFSIZE has been deleted and KERN_ELFSIZE should have always the
same values DB_ELFSIZE used to have.
In sys/exec_elf.h, if ELFSIZE is not set, it is set to KERN_ELFSIZE
for the kernel and ARCH_ELFSIZE for userland. These defaults should
eliminate the need for most manual ELFSIZE setting.
diffstat:
sys/arch/aarch64/include/elf_machdep.h | 3 ++-
sys/arch/acorn26/include/db_machdep.h | 3 +--
sys/arch/alpha/include/db_machdep.h | 3 +--
sys/arch/alpha/include/elf_machdep.h | 3 ++-
sys/arch/amd64/include/db_machdep.h | 3 +--
sys/arch/amd64/include/elf_machdep.h | 3 ++-
sys/arch/amiga/include/db_machdep.h | 3 +--
sys/arch/arm/include/db_machdep.h | 3 +--
sys/arch/arm/include/elf_machdep.h | 3 ++-
sys/arch/atari/include/db_machdep.h | 3 +--
sys/arch/cobalt/cobalt/machdep.c | 5 ++---
sys/arch/evbarm/ixm1200/ixm1200_machdep.c | 8 ++------
sys/arch/evbcf/include/db_machdep.h | 3 +--
sys/arch/evbmips/sbmips/machdep.c | 8 ++------
sys/arch/ews4800mips/ews4800mips/machdep.c | 8 ++------
sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c | 8 ++------
sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c | 8 ++------
sys/arch/hpcarm/include/db_machdep.h | 3 +--
sys/arch/hpcmips/hpcmips/machdep.c | 8 ++------
sys/arch/hpcsh/hpcsh/machdep.c | 8 ++------
sys/arch/hppa/include/db_machdep.h | 3 +--
sys/arch/hppa/include/elf_machdep.h | 3 ++-
sys/arch/i386/include/db_machdep.h | 3 +--
sys/arch/i386/include/elf_machdep.h | 3 ++-
sys/arch/ia64/include/db_machdep.h | 3 +--
sys/arch/ia64/include/elf_machdep.h | 1 +
sys/arch/landisk/landisk/machdep.c | 8 ++------
sys/arch/luna68k/include/db_machdep.h | 3 +--
sys/arch/m68k/include/db_machdep.h | 3 +--
sys/arch/m68k/include/elf_machdep.h | 3 ++-
sys/arch/mac68k/include/db_machdep.h | 3 +--
sys/arch/mips/include/db_machdep.h | 5 +----
sys/arch/mips/include/elf_machdep.h | 3 ++-
sys/arch/mvme68k/include/db_machdep.h | 3 +--
sys/arch/next68k/include/db_machdep.h | 3 +--
sys/arch/or1k/include/elf_machdep.h | 3 ++-
sys/arch/playstation2/include/db_machdep.h | 3 +--
sys/arch/playstation2/playstation2/machdep.c | 8 ++------
sys/arch/pmax/include/db_machdep.h | 3 +--
sys/arch/powerpc/include/db_machdep.h | 3 +--
sys/arch/powerpc/include/elf_machdep.h | 4 +++-
sys/arch/riscv/include/db_machdep.h | 5 +----
sys/arch/riscv/include/elf_machdep.h | 3 ++-
sys/arch/sbmips/sbmips/machdep.c | 8 ++------
sys/arch/sgimips/sgimips/machdep.c | 8 ++------
sys/arch/sh3/include/db_machdep.h | 3 +--
sys/arch/sh3/include/elf_machdep.h | 3 ++-
sys/arch/sparc/include/db_machdep.h | 3 +--
sys/arch/sparc/include/elf_machdep.h | 3 ++-
sys/arch/sparc64/include/db_machdep.h | 7 +------
sys/arch/sparc64/include/elf_machdep.h | 4 +++-
sys/arch/sun2/include/db_machdep.h | 3 +--
sys/arch/sun3/include/db_machdep.h | 3 +--
sys/arch/vax/include/db_machdep.h | 3 +--
sys/arch/vax/include/elf_machdep.h | 3 ++-
sys/arch/x68k/include/db_machdep.h | 3 +--
sys/arch/zaurus/include/db_machdep.h | 3 +--
57 files changed, 86 insertions(+), 150 deletions(-)
diffs (truncated from 1059 to 300 lines):
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/aarch64/include/elf_machdep.h
--- a/sys/arch/aarch64/include/elf_machdep.h Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/aarch64/include/elf_machdep.h Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: elf_machdep.h,v 1.1 2014/08/10 05:47:38 matt Exp $ */
+/* $NetBSD: elf_machdep.h,v 1.2 2017/11/06 03:47:45 christos Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -74,6 +74,7 @@
#define ELF64_MACHDEP_ID EM_AARCH64
+#define KERN_ELFSIZE 64
#define ARCH_ELFSIZE 64 /* MD native binary size */
/* Processor specific relocation types */
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/acorn26/include/db_machdep.h
--- a/sys/arch/acorn26/include/db_machdep.h Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/acorn26/include/db_machdep.h Mon Nov 06 03:47:45 2017 +0000
@@ -1,10 +1,9 @@
-/* $NetBSD: db_machdep.h,v 1.9 2013/01/05 15:04:00 christos Exp $ */
+/* $NetBSD: db_machdep.h,v 1.10 2017/11/06 03:47:45 christos Exp $ */
#include <arm/db_machdep.h>
/* acorn26 uses ELF */
#define DB_ELF_SYMBOLS
-#define DB_ELFSIZE 32
void db_show_frame_cmd(db_expr_t, bool, db_expr_t, const char *);
void db_bus_write_cmd(db_expr_t, bool, db_expr_t, const char *);
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/alpha/include/db_machdep.h
--- a/sys/arch/alpha/include/db_machdep.h Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/alpha/include/db_machdep.h Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.18 2011/05/26 15:34:12 joerg Exp $ */
+/* $NetBSD: db_machdep.h,v 1.19 2017/11/06 03:47:45 christos Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
@@ -107,7 +107,6 @@
* We use Elf64 symbols in DDB.
*/
#define DB_ELF_SYMBOLS
-#define DB_ELFSIZE 64
/*
* Stuff for KGDB.
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/alpha/include/elf_machdep.h
--- a/sys/arch/alpha/include/elf_machdep.h Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/alpha/include/elf_machdep.h Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: elf_machdep.h,v 1.12 2010/09/30 09:11:19 skrll Exp $ */
+/* $NetBSD: elf_machdep.h,v 1.13 2017/11/06 03:47:45 christos Exp $ */
#ifndef _ALPHA_ELF_MACHDEP_H_
#define _ALPHA_ELF_MACHDEP_H_
@@ -21,6 +21,7 @@
#define ELF64_MACHDEP_ID EM_ALPHA_EXP /* XXX */
+#define KERN_ELFSIZE 64
#define ARCH_ELFSIZE 64 /* MD native binary size */
/*
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/amd64/include/db_machdep.h
--- a/sys/arch/amd64/include/db_machdep.h Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/amd64/include/db_machdep.h Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.15 2015/07/26 10:49:05 mrg Exp $ */
+/* $NetBSD: db_machdep.h,v 1.16 2017/11/06 03:47:45 christos Exp $ */
/*
* Mach Operating System
@@ -141,7 +141,6 @@
#endif
#define DB_ELF_SYMBOLS
-#define DB_ELFSIZE 64
extern void db_machine_init(void);
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/amd64/include/elf_machdep.h
--- a/sys/arch/amd64/include/elf_machdep.h Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/amd64/include/elf_machdep.h Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: elf_machdep.h,v 1.5 2016/02/02 20:13:59 christos Exp $ */
+/* $NetBSD: elf_machdep.h,v 1.6 2017/11/06 03:47:45 christos Exp $ */
#if !defined __i386__
@@ -15,6 +15,7 @@
#define ELF32_MACHDEP_ID EM_386
#define ELF64_MACHDEP_ID EM_X86_64
+#define KERN_ELFSIZE 64
#define ARCH_ELFSIZE 64 /* MD native binary size */
/* x86-64 relocations */
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/amiga/include/db_machdep.h
--- a/sys/arch/amiga/include/db_machdep.h Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/amiga/include/db_machdep.h Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.5 2001/08/15 01:29:29 mhitch Exp $ */
+/* $NetBSD: db_machdep.h,v 1.6 2017/11/06 03:47:45 christos Exp $ */
#ifndef _MACHINE_DB_MACHDEP_H_
#define _MACHINE_DB_MACHDEP_H_
@@ -6,6 +6,5 @@
#include <m68k/db_machdep.h>
#define DB_ELF_SYMBOLS
-#define DB_ELFSIZE 32
#endif
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/arm/include/db_machdep.h
--- a/sys/arch/arm/include/db_machdep.h Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/arm/include/db_machdep.h Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.24 2017/02/20 17:27:32 skrll Exp $ */
+/* $NetBSD: db_machdep.h,v 1.25 2017/11/06 03:47:45 christos Exp $ */
/*
* Copyright (c) 1996 Scott K Stevens
@@ -121,7 +121,6 @@
int db_validate_address(vaddr_t addr);
#define DB_ELF_SYMBOLS
-#define DB_ELFSIZE 32
/*
* kgdb
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/arm/include/elf_machdep.h
--- a/sys/arch/arm/include/elf_machdep.h Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/arm/include/elf_machdep.h Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: elf_machdep.h,v 1.18 2017/08/10 19:03:27 joerg Exp $ */
+/* $NetBSD: elf_machdep.h,v 1.19 2017/11/06 03:47:45 christos Exp $ */
#ifndef _ARM_ELF_MACHDEP_H_
#define _ARM_ELF_MACHDEP_H_
@@ -41,6 +41,7 @@
#define ELF32_MACHDEP_ID EM_ARM
+#define KERN_ELFSIZE 32
#define ARCH_ELFSIZE 32 /* MD native binary size */
/* Processor specific relocation types */
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/atari/include/db_machdep.h
--- a/sys/arch/atari/include/db_machdep.h Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/atari/include/db_machdep.h Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.2 2001/09/24 09:21:24 leo Exp $ */
+/* $NetBSD: db_machdep.h,v 1.3 2017/11/06 03:47:46 christos Exp $ */
#ifndef _MACHINE_DB_MACHDEP_H_
#define _MACHINE_DB_MACHDEP_H_
@@ -6,6 +6,5 @@
#include <m68k/db_machdep.h>
#define DB_ELF_SYMBOLS
-#define DB_ELFSIZE 32
#endif
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/cobalt/cobalt/machdep.c
--- a/sys/arch/cobalt/cobalt/machdep.c Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/cobalt/cobalt/machdep.c Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.119 2016/12/22 14:47:54 cherry Exp $ */
+/* $NetBSD: machdep.c,v 1.120 2017/11/06 03:47:46 christos Exp $ */
/*-
* Copyright (c) 2006 Izumi Tsutsui. All rights reserved.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.119 2016/12/22 14:47:54 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.120 2017/11/06 03:47:46 christos Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -89,7 +89,6 @@
#if NKSYMS || defined(DDB) || defined(MODULAR)
#include <mips/db_machdep.h>
#include <ddb/db_extern.h>
-#define ELFSIZE DB_ELFSIZE
#include <sys/exec_elf.h>
#endif
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/evbarm/ixm1200/ixm1200_machdep.c
--- a/sys/arch/evbarm/ixm1200/ixm1200_machdep.c Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/evbarm/ixm1200/ixm1200_machdep.c Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixm1200_machdep.c,v 1.57 2016/12/22 14:47:55 cherry Exp $ */
+/* $NetBSD: ixm1200_machdep.c,v 1.58 2017/11/06 03:47:46 christos Exp $ */
/*
* Copyright (c) 2002, 2003
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixm1200_machdep.c,v 1.57 2016/12/22 14:47:55 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixm1200_machdep.c,v 1.58 2017/11/06 03:47:46 christos Exp $");
#include "opt_ddb.h"
#include "opt_modular.h"
@@ -90,10 +90,6 @@
#include <machine/db_machdep.h>
#include <ddb/db_sym.h>
#include <ddb/db_extern.h>
-#ifndef DB_ELFSIZE
-#error Must define DB_ELFSIZE!
-#endif
-#define ELFSIZE DB_ELFSIZE
#include <sys/exec_elf.h>
#endif
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/evbcf/include/db_machdep.h
--- a/sys/arch/evbcf/include/db_machdep.h Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/evbcf/include/db_machdep.h Mon Nov 06 03:47:45 2017 +0000
@@ -1,7 +1,6 @@
-/* $NetBSD: db_machdep.h,v 1.2 2014/03/18 18:20:41 riastradh Exp $ */
+/* $NetBSD: db_machdep.h,v 1.3 2017/11/06 03:47:46 christos Exp $ */
/* Just use the common m68k definition */
#include <m68k/db_machdep.h>
#define DB_ELF_SYMBOLS
-#define DB_ELFSIZE 32
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/evbmips/sbmips/machdep.c
--- a/sys/arch/evbmips/sbmips/machdep.c Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/evbmips/sbmips/machdep.c Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.2 2017/07/24 09:56:45 mrg Exp $ */
+/* $NetBSD: machdep.c,v 1.3 2017/11/06 03:47:46 christos Exp $ */
/*
* Copyright 2000, 2001
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.2 2017/07/24 09:56:45 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.3 2017/11/06 03:47:46 christos Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@@ -111,10 +111,6 @@
#include <ddb/db_access.h>
#include <ddb/db_sym.h>
#include <ddb/db_extern.h>
-#ifndef DB_ELFSIZE
-#error Must define DB_ELFSIZE!
-#endif
-#define ELFSIZE DB_ELFSIZE
#include <sys/exec_elf.h>
#endif
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/ews4800mips/ews4800mips/machdep.c
--- a/sys/arch/ews4800mips/ews4800mips/machdep.c Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/ews4800mips/ews4800mips/machdep.c Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.27 2016/12/22 14:47:57 cherry Exp $ */
+/* $NetBSD: machdep.c,v 1.28 2017/11/06 03:47:46 christos Exp $ */
/*-
* Copyright (c) 2001, 2004, 2005 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.27 2016/12/22 14:47:57 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.28 2017/11/06 03:47:46 christos Exp $");
#include "opt_ddb.h"
@@ -57,10 +57,6 @@
#include <ddb/db_sym.h>
#include <ddb/db_extern.h>
#include <ddb/db_output.h>
-#ifndef DB_ELFSIZE
-#error Must define DB_ELFSIZE!
-#endif
-#define ELFSIZE DB_ELFSIZE
#include <sys/exec_elf.h>
#endif
diff -r 7474644e9c55 -r 7f20341c72a2 sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c
--- a/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c Mon Nov 06 03:37:52 2017 +0000
+++ b/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c Mon Nov 06 03:47:45 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pxa2x0_hpc_machdep.c,v 1.23 2016/12/22 14:47:57 cherry Exp $ */
+/* $NetBSD: pxa2x0_hpc_machdep.c,v 1.24 2017/11/06 03:47:46 christos Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
Home |
Main Index |
Thread Index |
Old Index