Module Name: src
Committed By: matt
Date: Fri Aug 21 18:00:36 UTC 2009
Modified Files:
src/sys/kern [matt-nb5-mips64]: core_elf32.c exec_elf32.c
Log Message:
Add support for ELF_MD_PROBE_FUNC and ELF_COREDUMP_SETUP so that more
exact checks can be made before committing to execute or better info
about what's being dumped.
To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.32.16.1 src/sys/kern/core_elf32.c
cvs rdiff -u -r1.136 -r1.136.8.1 src/sys/kern/exec_elf32.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/core_elf32.c
diff -u src/sys/kern/core_elf32.c:1.32 src/sys/kern/core_elf32.c:1.32.16.1
--- src/sys/kern/core_elf32.c:1.32 Thu Apr 24 15:35:28 2008
+++ src/sys/kern/core_elf32.c Fri Aug 21 18:00:36 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: core_elf32.c,v 1.32 2008/04/24 15:35:28 ad Exp $ */
+/* $NetBSD: core_elf32.c,v 1.32.16.1 2009/08/21 18:00:36 matt Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.32 2008/04/24 15:35:28 ad Exp $");
+__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.32.16.1 2009/08/21 18:00:36 matt Exp $");
/* If not included by core_elf64.c, ELFSIZE won't be defined. */
#ifndef ELFSIZE
@@ -157,6 +157,10 @@
ehdr.e_shnum = 0;
ehdr.e_shstrndx = 0;
+#ifdef ELF_MD_COREDUMP_SETUP
+ ELF_MD_COREDUMP_SETUP(l, &ehdr);
+#endif
+
/* Write out the ELF header. */
error = coredump_write(cookie, UIO_SYSSPACE, &ehdr, sizeof(ehdr));
if (error)
Index: src/sys/kern/exec_elf32.c
diff -u src/sys/kern/exec_elf32.c:1.136 src/sys/kern/exec_elf32.c:1.136.8.1
--- src/sys/kern/exec_elf32.c:1.136 Mon Sep 15 18:12:56 2008
+++ src/sys/kern/exec_elf32.c Fri Aug 21 18:00:36 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_elf32.c,v 1.136 2008/09/15 18:12:56 rmind Exp $ */
+/* $NetBSD: exec_elf32.c,v 1.136.8.1 2009/08/21 18:00:36 matt Exp $ */
/*-
* Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: exec_elf32.c,v 1.136 2008/09/15 18:12:56 rmind Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exec_elf32.c,v 1.136.8.1 2009/08/21 18:00:36 matt Exp $");
/* If not included by exec_elf64.c, ELFSIZE won't be defined. */
#ifndef ELFSIZE
@@ -913,6 +913,10 @@
if ((error = netbsd_elf_signature(l, epp, eh)) != 0)
return error;
+#ifdef ELF_MD_PROBE_FUNC
+ if ((error = ELF_MD_PROBE_FUNC(l, epp, eh, itp, pos)) != 0)
+ return error;
+#endif
#ifdef ELF_INTERP_NON_RELOCATABLE
*pos = ELF_LINK_ADDR;
#endif