#include <sys/mman.h>
#include <stdio.h>
#include <varargs.h>
-#ifndef __NetBSD__
+#if !defined (__NetBSD__) && !defined (__OpenBSD__)
#include <filehdr.h>
#include <aouthdr.h>
#include <scnhdr.h>
# include <reloc.h>
# include <elf_abi.h>
#endif
-#else /* __NetBSD__ */
+#else /* __NetBSD__ or __OpenBSD__ */
/*
* NetBSD/Alpha does not have 'normal' user-land ECOFF support because
* there's no desire to support ECOFF as the executable format in the
#define HDRR struct ecoff_symhdr
#define pHDRR HDRR *
#define cbHDRR sizeof(HDRR)
+#ifdef __OpenBSD__
+#define ALPHAMAGIC ECOFF_MAGIC_NATIVE_ALPHA
+#else
#define ALPHAMAGIC ECOFF_MAGIC_NETBSD_ALPHA
+#endif
#define ZMAGIC ECOFF_ZMAGIC
/* Misc. constants that NetBSD doesn't define at all. */
#define _RDATA ".rdata"
#define _SDATA ".sdata"
#define _SBSS ".sbss"
-#endif /* __NetBSD__ */
+#endif /* __NetBSD__ || __OpenBSD__ */
static void fatal_unexec ();
static void mark_x ();
if (nhdr.fhdr.f_opthdr != sizeof (nhdr.aout))
{
fprintf (stderr, "unexec: input a.out header is %d bytes, not %d.\n",
- nhdr.fhdr.f_opthdr, sizeof (nhdr.aout));
+ nhdr.fhdr.f_opthdr, (int)sizeof (nhdr.aout));
exit (1);
}
if (nhdr.aout.magic != ZMAGIC)
int new; /* File descriptor for new executable */
struct aouthdr aout; /* a.out info from the file header */
{
-#if !defined (__linux__) && !defined (__NetBSD__)
+#if !defined (__linux__) && !defined (__NetBSD__) && !defined (__OpenBSD__)
typedef struct dynrel_info {
char * addr;
}
-#endif /* not __linux__ and not __NetBSD__ */
+#endif /* not __linux__ and not __NetBSD__ and not __OpenBSD__ */
}
\f