From d8f62859c7ad1fea8082e72f0fcd22d279aaeaa6 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 16 Oct 2016 12:21:32 -0400 Subject: [PATCH] Library init passes the library module handle on the stack, as it should. --- lx_loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lx_loader.c b/lx_loader.c index 76e0aad..fc5ee5e 100644 --- a/lx_loader.c +++ b/lx_loader.c @@ -494,7 +494,7 @@ static void runLxLibraryInitOrTerm(LxModule *lxmod, const int isTermination) "movl %%esi,%%esp \n\t" // use the OS/2 process's stack. "pushl %%ecx \n\t" // save original stack pointer for real. "pushl %%eax \n\t" // isTermination - "pushl $0 \n\t" // library module handle !!! FIXME + "pushl %%edx \n\t" // library module handle "leal 1f,%%eax \n\t" // address that entry point should return to. "pushl %%eax \n\t" "pushl %%edi \n\t" // the OS/2 library entry point (we'll "ret" to it instead of jmp, so stack and registers are all correct). @@ -513,7 +513,7 @@ static void runLxLibraryInitOrTerm(LxModule *lxmod, const int isTermination) "popfl \n\t" // restore our original flags. "popal \n\t" // restore our original registers. : // no outputs - : "a" (isTermination), "S" (stack), "D" (lxmod->eip) + : "a" (isTermination), "d" (lxmod), "S" (stack), "D" (lxmod->eip) : "memory" );