mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-26 07:33:47 +00:00
[MSDOS]: Don't #include <a.out.h>, but use other headers.
(make_hdr) [MSDOS]: Cast a pointer for bzero. (write_segment) [EFAULT]: Check for before using. (adjust_lnnoptrs) [MSDOS]: Use provided descriptor. (adjust_lnnoptrs): Return 0 if ok.
This commit is contained in:
parent
8e99c732db
commit
3680bdc6ff
41
src/unexec.c
41
src/unexec.c
@ -176,7 +176,31 @@ pointer looks like an int) but not on all machines.
|
||||
int need_coff_header = 1;
|
||||
#include <coff-encap/a.out.encap.h> /* The location might be a poor assumption */
|
||||
#else
|
||||
#ifdef MSDOS
|
||||
#include <../go32/gotypes.h>
|
||||
#include <../go32/ed/coff.h>
|
||||
#define filehdr external_filehdr
|
||||
#define scnhdr external_scnhdr
|
||||
#define syment external_syment
|
||||
#define auxent external_auxent
|
||||
#define n_numaux e_numaux
|
||||
#define n_type e_type
|
||||
struct aouthdr
|
||||
{
|
||||
word16 magic; /* type of file */
|
||||
word16 vstamp; /* version stamp */
|
||||
word32 tsize; /* text size in bytes, padded to FW bdry*/
|
||||
word32 dsize; /* initialized data " " */
|
||||
word32 bsize; /* uninitialized data " " */
|
||||
word32 entry; /* entry pt. */
|
||||
word32 text_start; /* base of text used for this file */
|
||||
word32 data_start; /* base of data used for this file */
|
||||
};
|
||||
|
||||
|
||||
#else /* not MSDOS */
|
||||
#include <a.out.h>
|
||||
#endif /* not MSDOS */
|
||||
#endif
|
||||
|
||||
/* Define getpagesize () if the system does not.
|
||||
@ -685,8 +709,12 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
|
||||
* but I don't have that much time or incentive.
|
||||
*/
|
||||
ERROR0 ("can't build a COFF file from scratch yet");
|
||||
#else
|
||||
#ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
|
||||
bzero ((void *)&hdr, sizeof hdr);
|
||||
#else
|
||||
bzero (&hdr, sizeof hdr);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -898,7 +926,11 @@ write_segment (new, ptr, end)
|
||||
a gap between the old text segment and the old data segment.
|
||||
This gap has probably been remapped into part of the text segment.
|
||||
So write zeros for it. */
|
||||
if (ret == -1 && errno == EFAULT)
|
||||
if (ret == -1
|
||||
#ifdef EFAULT
|
||||
&& errno == EFAULT
|
||||
#endif
|
||||
)
|
||||
write (new, zeros, nwrite);
|
||||
else if (nwrite != ret)
|
||||
{
|
||||
@ -1021,7 +1053,11 @@ adjust_lnnoptrs (writedesc, readdesc, new_name)
|
||||
if (!lnnoptr || !f_hdr.f_symptr)
|
||||
return 0;
|
||||
|
||||
#ifdef MSDOS
|
||||
if ((new = writedesc) < 0)
|
||||
#else
|
||||
if ((new = open (new_name, 2)) < 0)
|
||||
#endif
|
||||
{
|
||||
PERROR (new_name);
|
||||
return -1;
|
||||
@ -1043,7 +1079,10 @@ adjust_lnnoptrs (writedesc, readdesc, new_name)
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef MSDOS
|
||||
close (new);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* COFF_BSD_SYMBOLS */
|
||||
|
Loading…
Reference in New Issue
Block a user