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 |
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" |
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" |
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" |