Module Name: src
Committed By: riz
Date: Sun Nov 8 00:57:09 UTC 2015
Modified Files:
src/sys/kern [netbsd-7]: exec_elf.c
src/sys/sys [netbsd-7]: exec_elf.h
Log Message:
Pull up following revision(s) (requested by christos in ticket #1019):
sys/kern/exec_elf.c: revision 1.79
sys/sys/exec_elf.h: revision 1.150
sys/sys/exec_elf.h: revision 1.151
sys/kern/exec_elf.c: revision 1.80
Ignore the ancient 01.01 tag that gnuc used to put in old NetBSD binaries.
Add buildid Go note
To generate a diff of this commit:
cvs rdiff -u -r1.69.2.2 -r1.69.2.3 src/sys/kern/exec_elf.c
cvs rdiff -u -r1.141 -r1.141.2.1 src/sys/sys/exec_elf.h
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/exec_elf.c
diff -u src/sys/kern/exec_elf.c:1.69.2.2 src/sys/kern/exec_elf.c:1.69.2.3
--- src/sys/kern/exec_elf.c:1.69.2.2 Sun Mar 29 09:07:55 2015
+++ src/sys/kern/exec_elf.c Sun Nov 8 00:57:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_elf.c,v 1.69.2.2 2015/03/29 09:07:55 martin Exp $ */
+/* $NetBSD: exec_elf.c,v 1.69.2.3 2015/11/08 00:57:09 riz 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.69.2.2 2015/03/29 09:07:55 martin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.69.2.3 2015/11/08 00:57:09 riz Exp $");
#ifdef _KERNEL_OPT
#include "opt_pax.h"
@@ -939,13 +939,20 @@ netbsd_elf_signature(struct lwp *l, stru
}
/*
- * Ignore SuSE tags; SuSE's n_type is the same as NetBSD's
- * one.
+ * Ignore SuSE tags; SuSE's n_type is the same the
+ * NetBSD one.
*/
if (np->n_namesz == ELF_NOTE_SUSE_NAMESZ &&
memcmp(ndata, ELF_NOTE_SUSE_NAME,
ELF_NOTE_SUSE_NAMESZ) == 0)
break;
+ /*
+ * Ignore old GCC
+ */
+ if (np->n_namesz == ELF_NOTE_OGCC_NAMESZ &&
+ memcmp(ndata, ELF_NOTE_OGCC_NAME,
+ ELF_NOTE_OGCC_NAMESZ) == 0)
+ break;
BADNOTE("NetBSD tag");
goto bad;
@@ -1004,6 +1011,9 @@ netbsd_elf_signature(struct lwp *l, stru
case ELF_NOTE_TYPE_SUSE_VERSION_TAG:
break;
+ case ELF_NOTE_TYPE_GO_BUILDID_TAG:
+ break;
+
default:
BADNOTE("unknown tag");
bad:
Index: src/sys/sys/exec_elf.h
diff -u src/sys/sys/exec_elf.h:1.141 src/sys/sys/exec_elf.h:1.141.2.1
--- src/sys/sys/exec_elf.h:1.141 Tue Jul 8 17:16:25 2014
+++ src/sys/sys/exec_elf.h Sun Nov 8 00:57:09 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_elf.h,v 1.141 2014/07/08 17:16:25 maxv Exp $ */
+/* $NetBSD: exec_elf.h,v 1.141.2.1 2015/11/08 00:57:09 riz Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -822,6 +822,11 @@ typedef struct {
#define ELF_NOTE_ABI_OS_KFREEBSD 3
#define ELF_NOTE_ABI_OS_KNETBSD 4
+/* Old gcc style, under the ABI tag */
+#define ELF_NOTE_OGCC_NAMESZ 8
+#define ELF_NOTE_OGCC_NAME "01.01\0\0\0\0"
+#define ELF_NOTE_OGCC_DESCSZ 0
+
/*
* GNU-specific note type: Hardware capabilities
* name: GNU\0
@@ -881,6 +886,18 @@ typedef struct {
/* SuSE-specific note name */
#define ELF_NOTE_SUSE_VERSION_NAME "SuSE\0\0\0\0"
+/* Go-specific note type: buildid
+ * name: Go\0\0
+ * namesz: 4
+ * desc:
+ * words[10]
+ * descsz: 40
+ */
+#define ELF_NOTE_TYPE_GO_BUILDID_TAG 4
+#define ELF_NOTE_GO_BUILDID_NAMESZ 4
+#define ELF_NOTE_GO_BUILDID_DESCSZ 40
+#define ELF_NOTE_GO_BUILDID_NAME "Go\0\0"
+
/* NetBSD-specific note type: Emulation name.
* name: NetBSD\0\0
* namesz: 8