diff options
| -rw-r--r-- | src/unexmips.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/unexmips.c b/src/unexmips.c index 32f015f5732..4eeee03f736 100644 --- a/src/unexmips.c +++ b/src/unexmips.c | |||
| @@ -36,8 +36,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 36 | #include <scnhdr.h> | 36 | #include <scnhdr.h> |
| 37 | #include <sym.h> | 37 | #include <sym.h> |
| 38 | 38 | ||
| 39 | #ifdef IRIS_4D | 39 | #if defined (IRIS_4D) || defined (sony) |
| 40 | #include "getpagesize.h" | 40 | #include "getpagesize.h" |
| 41 | #include <fcntl.h> | ||
| 41 | #endif | 42 | #endif |
| 42 | 43 | ||
| 43 | static void fatal_unexec (); | 44 | static void fatal_unexec (); |
| @@ -112,11 +113,11 @@ unexec (new_name, a_name, data_start, bss_start, entry_address) | |||
| 112 | && hdr.fhdr.f_magic != (MIPSELMAGIC | 1) | 113 | && hdr.fhdr.f_magic != (MIPSELMAGIC | 1) |
| 113 | && hdr.fhdr.f_magic != (MIPSEBMAGIC | 1)) | 114 | && hdr.fhdr.f_magic != (MIPSEBMAGIC | 1)) |
| 114 | { | 115 | { |
| 115 | fprintf(stderr, | 116 | fprintf (stderr, |
| 116 | "unexec: input file magic number is %x, not %x, %x, %x or %x.\n", | 117 | "unexec: input file magic number is %x, not %x, %x, %x or %x.\n", |
| 117 | hdr.fhdr.f_magic, | 118 | hdr.fhdr.f_magic, |
| 118 | MIPSELMAGIC, MIPSEBMAGIC, | 119 | MIPSELMAGIC, MIPSEBMAGIC, |
| 119 | MIPSELMAGIC | 1, MIPSEBMAGIC | 1); | 120 | MIPSELMAGIC | 1, MIPSEBMAGIC | 1); |
| 120 | exit(1); | 121 | exit(1); |
| 121 | } | 122 | } |
| 122 | #else /* not MIPS2 */ | 123 | #else /* not MIPS2 */ |
| @@ -163,9 +164,14 @@ unexec (new_name, a_name, data_start, bss_start, entry_address) | |||
| 163 | CHECK_SCNHDR (sdata_section, _SDATA, STYP_SDATA); | 164 | CHECK_SCNHDR (sdata_section, _SDATA, STYP_SDATA); |
| 164 | CHECK_SCNHDR (sbss_section, _SBSS, STYP_SBSS); | 165 | CHECK_SCNHDR (sbss_section, _SBSS, STYP_SBSS); |
| 165 | CHECK_SCNHDR (bss_section, _BSS, STYP_BSS); | 166 | CHECK_SCNHDR (bss_section, _BSS, STYP_BSS); |
| 167 | #if 0 /* Apparently this error check goes off on irix 3.3, | ||
| 168 | but it doesn't indicate a real problem. */ | ||
| 166 | if (i != hdr.fhdr.f_nscns) | 169 | if (i != hdr.fhdr.f_nscns) |
| 167 | fprintf (stderr, "unexec: %d sections found instead of %d.\n", | 170 | fprintf (stderr, "unexec: %d sections found instead of %d.\n", |
| 168 | i, hdr.fhdr.f_nscns); | 171 | i, hdr.fhdr.f_nscns); |
| 172 | #endif | ||
| 173 | |||
| 174 | text_section->s_scnptr = 0; | ||
| 169 | 175 | ||
| 170 | pagesize = getpagesize (); | 176 | pagesize = getpagesize (); |
| 171 | brk = (sbrk (0) + pagesize - 1) & (-pagesize); | 177 | brk = (sbrk (0) + pagesize - 1) & (-pagesize); |