mirror of
https://github.com/dreamlayers/netbsd-mopd.git
synced 2026-01-11 23:43:12 +00:00
Use modified NetBSD header files to make mopcopy work for a.out.
This commit is contained in:
parent
32e5361f58
commit
0cc2781873
@ -3,7 +3,8 @@ SRCS+=cmp.c device.c dl.c file.c get.c log.c loop-linux2.c mopdef.c nma.c
|
||||
SRCS+=pf-linux2.c print.c put.c rc.c version.c
|
||||
OBJS+=${SRCS:.c=.o}
|
||||
|
||||
CFLAGS+=-DNOAOUT
|
||||
# Not needed as long as including of files from netbsd_h works
|
||||
#CFLAGS+=-DNOAOUT
|
||||
|
||||
libcommon.a: ${OBJS}
|
||||
ar cr $@ ${OBJS}
|
||||
|
||||
@ -38,12 +38,10 @@ __RCSID("$NetBSD: file.c,v 1.16 2016/06/08 01:11:49 christos Exp $");
|
||||
#ifndef NOAOUT
|
||||
# if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
# include <sys/exec_aout.h>
|
||||
# endif
|
||||
# if defined(__bsdi__)
|
||||
# define NOAOUT
|
||||
# endif
|
||||
# if defined(__FreeBSD__)
|
||||
# elif defined(__FreeBSD__)
|
||||
# include <sys/imgact_aout.h>
|
||||
# else
|
||||
# include "../netbsd_h/exec_aout.h"
|
||||
# endif
|
||||
# if !defined(MID_VAX)
|
||||
# define MID_VAX 140
|
||||
|
||||
@ -3,7 +3,8 @@ SRCS=mopcopy.c
|
||||
OBJS=${SRCS:.c=.o}
|
||||
|
||||
LDLIBS+=../common/libcommon.a
|
||||
CFLAGS+=-I../common -DNOAOUT
|
||||
CFLAGS+=-I../common
|
||||
# -DNOAOUT not needed as long as including of files from netbsd_h works
|
||||
|
||||
mopcopy: ${OBJS}
|
||||
|
||||
|
||||
@ -59,9 +59,10 @@ __RCSID("$NetBSD: mopcopy.c,v 1.7 2019/12/27 09:41:52 msaitoh Exp $");
|
||||
#if !defined(NOAOUT)
|
||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
#include <sys/exec_aout.h>
|
||||
#endif
|
||||
#if defined(__FreeBSD__)
|
||||
#elif defined(__FreeBSD__)
|
||||
#include <sys/imgact_aout.h>
|
||||
#else
|
||||
#include "../netbsd_h/exec_aout.h"
|
||||
#endif
|
||||
#endif /* !NOAOUT */
|
||||
#if defined(__bsdi__)
|
||||
|
||||
@ -42,15 +42,19 @@
|
||||
* only manipulate the a_midmag field via the
|
||||
* N_SETMAGIC/N_GET{MAGIC,MID,FLAG} macros below.
|
||||
*/
|
||||
/* VAXen are 32 bit and this might get compiled on 64 bit machines,
|
||||
* so unsigned long changed to uint32_t for mopd portability.
|
||||
*/
|
||||
#include <stdint.h>
|
||||
struct exec {
|
||||
unsigned long a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */
|
||||
unsigned long a_text; /* text segment size */
|
||||
unsigned long a_data; /* initialized data size */
|
||||
unsigned long a_bss; /* uninitialized data size */
|
||||
unsigned long a_syms; /* symbol table size */
|
||||
unsigned long a_entry; /* entry point */
|
||||
unsigned long a_trsize; /* text relocation size */
|
||||
unsigned long a_drsize; /* data relocation size */
|
||||
uint32_t a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */
|
||||
uint32_t a_text; /* text segment size */
|
||||
uint32_t a_data; /* initialized data size */
|
||||
uint32_t a_bss; /* uninitialized data size */
|
||||
uint32_t a_syms; /* symbol table size */
|
||||
uint32_t a_entry; /* entry point */
|
||||
uint32_t a_trsize; /* text relocation size */
|
||||
uint32_t a_drsize; /* data relocation size */
|
||||
};
|
||||
|
||||
/* a_magic */
|
||||
@ -59,7 +63,8 @@ struct exec {
|
||||
#define ZMAGIC 0413 /* demand load format */
|
||||
#define QMAGIC 0314 /* "compact" demand load format; deprecated */
|
||||
|
||||
#include <sys/aout_mids.h>
|
||||
/* Changed for mopd, instead using other file in netbsd_h directory */
|
||||
#include "aout_mids.h"
|
||||
|
||||
/*
|
||||
* a_flags
|
||||
@ -150,7 +155,9 @@ struct exec {
|
||||
#define N_STROFF(ex) \
|
||||
(N_SYMOFF(ex) + (ex).a_syms)
|
||||
|
||||
#include <machine/aout_machdep.h>
|
||||
|
||||
/* Not needed for mopd */
|
||||
/* #include <machine/aout_machdep.h> */
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user