#define PERROR(arg) perror(arg);exit(-1)
-#ifndef HAVE_A_OUT_H
+#if !defined(HAVE_A_OUT_H) && !defined(WIN32_NATIVE)
unexec (char *, char *, void *, void *, void *)
{
PERROR("cannot unexec() a.out.h not installed");
#ifndef MAX_PATH
#define MAX_PATH 260
#endif
+
+#ifdef MINGW
+#include <../../include/a.out.h>
+#else
#include <a.out.h>
+#endif
+#define STACK_SIZE 0x800000
#define ALLOC_UNIT 0xFFFF
#define ALLOC_MASK ~((unsigned long)(ALLOC_UNIT))
#define ALIGN_ALLOC(addr) \
}
f_ohdr.dsize=new_data_size;
f_ohdr.bsize=BSS_PAD_SIZE;
+ /* Prevent stack overflow with regexp usage. */
+ f_ohdr.SizeOfStackReserve = STACK_SIZE;
+
if (write(a_new, &f_ohdr, sizeof(f_ohdr)) != sizeof(f_ohdr))
{
PERROR("failed to write optional header");