Hi/2.
From cc66576989f8f09ec0031c2d7314cc67dfdfa072 Mon Sep 17 00:00:00 2001
From: KO Myung-Hun <komh78@gmail.com>
Date: Sat, 9 May 2026 17:55:48 +0900
Subject: [PATCH] emxbind: support a.out including os2_bind_header of old-EMX
startup code
---
src/emx/src/emxbind/fixup.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/emx/src/emxbind/fixup.c b/src/emx/src/emxbind/fixup.c
index 02b316d..1ba57f8 100644
--- a/src/emx/src/emxbind/fixup.c
+++ b/src/emx/src/emxbind/fixup.c
@@ -575,7 +575,15 @@ void os2_fixup (void)
my_seek (&inp_file, data_base + data_off);
my_read (&set_len, sizeof (set_len), &inp_file);
if (set_len != DATASEG_MAGIC)
- error ("invalid data segment (does not start with 0x%x)", DATASEG_MAGIC);
+ {
+ my_seek (&inp_file, data_base + data_off + sizeof (dword) * 13);
+ my_read (&set_len, sizeof (set_len), &inp_file);
+ /* Check if os2_bind_header of old-EMX startup code */
+ if (set_len != 0x02000000 /* flags: a.out application */
+ && set_len != 0x02000001) /* flags: a.out DLL */
+ error ("invalid data segment (does not start with 0x%x)", DATASEG_MAGIC);
+ my_seek (&inp_file, data_base + data_off + sizeof (dword) * 10);
+ }
/* Now read the offset to the __os2_dll set */
my_read (&set_len, sizeof (set_len), &inp_file);
--
2.50.1
Hi/2.
emxbinddoes not support a.out objs with old-EMX startup code, which is used by Free Pascal. For details, see komh/cross-os2emx#30.Here is the patch:
0001-emxbind-support-a.out-including-os2_bind_header-of-o.patch