/[grub]/grub/util/mbchk.c
ViewVC logotype

Diff of /grub/util/mbchk.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by okuji, Tue Dec 11 07:49:17 2001 UTC revision 1.4 by okuji, Wed May 22 17:08:37 2002 UTC
# Line 1  Line 1 
1  /* mbchk - a simple checker for the format of a Multiboot kernel */  /* mbchk - a simple checker for the format of a Multiboot kernel */
2  /*  /*
3   *  Copyright (C) 1999, 2001  Free Software Foundation, Inc.   *  Copyright (C) 1999,2001,2002  Free Software Foundation, Inc.
4   *   *
5   *  This program is free software; you can redistribute it and/or modify   *  This program is free software; you can redistribute it and/or modify
6   *  it under the terms of the GNU General Public License as published by   *  it under the terms of the GNU General Public License as published by
# Line 126  check_multiboot (const char *filename, F Line 126  check_multiboot (const char *filename, F
126            return 0;            return 0;
127          }          }
128    
129        if (mbh->load_addr >= mbh->load_end_addr)        if (mbh->load_end_addr && mbh->load_addr >= mbh->load_end_addr)
130          {          {
131            fprintf (stderr,            fprintf (stderr,
132                     "%s: load_addr is not less than load_end_addr"                     "%s: load_addr is not less than load_end_addr"
# Line 135  check_multiboot (const char *filename, F Line 135  check_multiboot (const char *filename, F
135            return 0;            return 0;
136          }          }
137    
138        if (mbh->load_end_addr > mbh->bss_end_addr)        if (mbh->bss_end_addr && mbh->load_end_addr > mbh->bss_end_addr)
139          {          {
140            fprintf (stderr,            fprintf (stderr,
141                     "%s: load_end_addr is greater than bss_end_addr"                     "%s: load_end_addr is greater than bss_end_addr"
# Line 153  check_multiboot (const char *filename, F Line 153  check_multiboot (const char *filename, F
153            return 0;            return 0;
154          }          }
155    
156        if (mbh->load_end_addr <= mbh->entry_addr)        /* FIXME: It is better to check if the entry address is within the
157             file, especially when the load end address is zero.  */
158          if (mbh->load_end_addr && mbh->load_end_addr <= mbh->entry_addr)
159          {          {
160            fprintf (stderr,            fprintf (stderr,
161                     "%s: load_end_addr is not less than entry_addr"                     "%s: load_end_addr is not less than entry_addr"

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26