From 949fc37b473f752296908db4077496f6a60d955d Mon Sep 17 00:00:00 2001
From: ram <ram>
Date: Sat, 1 Oct 1994 00:22:39 +0000
Subject: [PATCH] Patch from TSM for calling dynamically linked foreign
 routines.

---
 lisp/hppa-assem.S | 8 +++++---
 lisp/hppa-assem.s | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/lisp/hppa-assem.S b/lisp/hppa-assem.S
index 2770bc528..d800c92c8 100644
--- a/lisp/hppa-assem.S
+++ b/lisp/hppa-assem.S
@@ -189,9 +189,11 @@ call_into_c
 	/* Turn off pseudo-atomic and check for traps. */
 	addit,od	-4,reg_ALLOC,reg_ALLOC
 
-	/* Now we can call the C function. */
-	ble	0(4,reg_CFUNC)
-	copy	r31, r2
+	/* in order to be able to call incrementally linked (ld -A) functions,
+	   we have to do some mild trickery here */
+	copy  reg_CFUNC,%r22
+	bl    $$dyncall,r31
+	copy  r31, r2
 
 	/* Clear the callee saves descriptor regs. */
 	copy	r0, reg_A5
diff --git a/lisp/hppa-assem.s b/lisp/hppa-assem.s
index 2770bc528..d800c92c8 100644
--- a/lisp/hppa-assem.s
+++ b/lisp/hppa-assem.s
@@ -189,9 +189,11 @@ call_into_c
 	/* Turn off pseudo-atomic and check for traps. */
 	addit,od	-4,reg_ALLOC,reg_ALLOC
 
-	/* Now we can call the C function. */
-	ble	0(4,reg_CFUNC)
-	copy	r31, r2
+	/* in order to be able to call incrementally linked (ld -A) functions,
+	   we have to do some mild trickery here */
+	copy  reg_CFUNC,%r22
+	bl    $$dyncall,r31
+	copy  r31, r2
 
 	/* Clear the callee saves descriptor regs. */
 	copy	r0, reg_A5
-- 
GitLab