Module Name: src Committed By: maxv Date: Wed Nov 1 17:00:18 UTC 2017
Modified Files: src/sys/arch/amd64/stand/prekern: elf.c Log Message: Handle absolute symbols. Since my linux_sigcode.S::rev1.4 there are two Elf_Rela that point to the NULL symbol - which the prekern thought was an external reference. In the ELF spec, STN_UNDEF means the value of the symbol is zero. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 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.5 src/sys/arch/amd64/stand/prekern/elf.c:1.6 --- src/sys/arch/amd64/stand/prekern/elf.c:1.5 Sun Oct 29 11:38:43 2017 +++ src/sys/arch/amd64/stand/prekern/elf.c Wed Nov 1 17:00:17 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: elf.c,v 1.5 2017/10/29 11:38:43 maxv Exp $ */ +/* $NetBSD: elf.c,v 1.6 2017/11/01 17:00:17 maxv Exp $ */ /* * Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved. @@ -147,6 +147,10 @@ elf_sym_lookup(size_t symidx) char *buf, *secname; Elf_Shdr *sec; + if (symidx == STN_UNDEF) { + return 0; + } + if (symidx >= eif.symcnt) { fatal("elf_sym_lookup: symbol beyond table"); }