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/8f9499536ca1
branches:  trunk
changeset: 460345:8f9499536ca1
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 0379b324039a -r 8f9499536ca1 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