Module Name: src
Committed By: maxv
Date: Wed Oct 11 16:21:06 UTC 2017
Modified Files:
src/sys/arch/amd64/stand/prekern: elf.c
Log Message:
Make sure we're relocating a relocatable kernel.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amd64/stand/prekern/elf.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/arch/amd64/stand/prekern/elf.c
diff -u src/sys/arch/amd64/stand/prekern/elf.c:1.1 src/sys/arch/amd64/stand/prekern/elf.c:1.2
--- src/sys/arch/amd64/stand/prekern/elf.c:1.1 Tue Oct 10 09:29:14 2017
+++ src/sys/arch/amd64/stand/prekern/elf.c Wed Oct 11 16:21:06 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: elf.c,v 1.1 2017/10/10 09:29:14 maxv Exp $ */
+/* $NetBSD: elf.c,v 1.2 2017/10/11 16:21:06 maxv Exp $ */
/*
* Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved.
@@ -86,7 +86,8 @@ static int
elf_check_header()
{
if (memcmp((char *)eif.ehdr->e_ident, ELFMAG, SELFMAG) != 0 ||
- eif.ehdr->e_ident[EI_CLASS] != ELFCLASS) {
+ eif.ehdr->e_ident[EI_CLASS] != ELFCLASS ||
+ eif.ehdr->e_type != ET_REL) {
return -1;
}
return 0;