# HG changeset patch # User Richard M. Stallman # Date 720214975 0 # Node ID 1a12c5f1c04d25646cad49a9f24288e766e05d3b # Parent a6da00e1c5ad1ae52585ffaa7442fb45317f0d42 [sony, IRIS_4D]: Include getpagesize.h and fcntl.h. (unexec): #if 0 the error check of hdr.fhdr.f_nscns. Clear text_section->s_scnptr. diff -r a6da00e1c5ad -r 1a12c5f1c04d src/unexmips.c --- a/src/unexmips.c Tue Oct 27 10:21:22 1992 +0000 +++ b/src/unexmips.c Tue Oct 27 19:42:55 1992 +0000 @@ -36,8 +36,9 @@ #include #include -#ifdef IRIS_4D +#if defined (IRIS_4D) || defined (sony) #include "getpagesize.h" +#include #endif static void fatal_unexec (); @@ -112,11 +113,11 @@ && hdr.fhdr.f_magic != (MIPSELMAGIC | 1) && hdr.fhdr.f_magic != (MIPSEBMAGIC | 1)) { - fprintf(stderr, - "unexec: input file magic number is %x, not %x, %x, %x or %x.\n", - hdr.fhdr.f_magic, - MIPSELMAGIC, MIPSEBMAGIC, - MIPSELMAGIC | 1, MIPSEBMAGIC | 1); + fprintf (stderr, + "unexec: input file magic number is %x, not %x, %x, %x or %x.\n", + hdr.fhdr.f_magic, + MIPSELMAGIC, MIPSEBMAGIC, + MIPSELMAGIC | 1, MIPSEBMAGIC | 1); exit(1); } #else /* not MIPS2 */ @@ -163,9 +164,14 @@ CHECK_SCNHDR (sdata_section, _SDATA, STYP_SDATA); CHECK_SCNHDR (sbss_section, _SBSS, STYP_SBSS); CHECK_SCNHDR (bss_section, _BSS, STYP_BSS); +#if 0 /* Apparently this error check goes off on irix 3.3, + but it doesn't indicate a real problem. */ if (i != hdr.fhdr.f_nscns) fprintf (stderr, "unexec: %d sections found instead of %d.\n", i, hdr.fhdr.f_nscns); +#endif + + text_section->s_scnptr = 0; pagesize = getpagesize (); brk = (sbrk (0) + pagesize - 1) & (-pagesize);