Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/i386 Fix multiboot1 kernel symbol load



details:   https://anonhg.NetBSD.org/src/rev/c54e15198a3b
branches:  trunk
changeset: 845836:c54e15198a3b
user:      manu <manu%NetBSD.org@localhost>
date:      Fri Oct 18 01:19:00 2019 +0000

description:
Fix multiboot1 kernel symbol load

ELF_Shdr's sh_type field is a value, not a flag field

diffstat:

 sys/arch/i386/i386/multiboot.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 53f1b2cad3c9 -r c54e15198a3b sys/arch/i386/i386/multiboot.c
--- a/sys/arch/i386/i386/multiboot.c    Fri Oct 18 01:15:54 2019 +0000
+++ b/sys/arch/i386/i386/multiboot.c    Fri Oct 18 01:19:00 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: multiboot.c,v 1.24 2018/11/08 06:23:48 msaitoh Exp $   */
+/*     $NetBSD: multiboot.c,v 1.25 2019/10/18 01:19:00 manu Exp $      */
 
 /*-
  * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: multiboot.c,v 1.24 2018/11/08 06:23:48 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: multiboot.c,v 1.25 2019/10/18 01:19:00 manu Exp $");
 
 #include "opt_multiboot.h"
 
@@ -302,14 +302,14 @@
 
                shdrp = &((Elf32_Shdr *)mi->mi_elfshdr_addr)[i];
 
-               if ((shdrp->sh_type & SHT_SYMTAB) &&
+               if ((shdrp->sh_type == SHT_SYMTAB) &&
                    shdrp->sh_link != SHN_UNDEF) {
                        Elf32_Shdr *shdrp2;
 
                        shdrp2 = &((Elf32_Shdr *)mi->mi_elfshdr_addr)
                            [shdrp->sh_link];
 
-                       if (shdrp2->sh_type & SHT_STRTAB) {
+                       if (shdrp2->sh_type == SHT_STRTAB) {
                                symtabp = shdrp;
                                strtabp = shdrp2;
                        }



Home | Main Index | Thread Index | Old Index