[parisc-linux] Re: c++ problem

Alan Modra alan@linuxcare.com.au
Wed, 21 Mar 2001 11:37:11 +1100 (EST)


On Wed, 21 Mar 2001, Alan Modra wrote:

> I propose we set up dp in the dynamic linker to avoid this problem, as
> it's quite legal to have a mix of static and dynamic libraries, each
> needing to run constructors.

I think this is all we need.  Compiling it all to test it out...

--- glibc/sysdeps/hppa/dl-machine.h~	Mon Feb 19 14:05:42 2001
+++ glibc/sysdeps/hppa/dl-machine.h	Wed Mar 21 10:45:50 2001
@@ -338,6 +338,10 @@
 	/* Save the entry point in %r3. */
 	copy	%ret0,%r3
 
+	/* Set up dp for any static lib constructors that may be called. */
+	addil	LT'$global$,%r19
+	ldw	RT'$global$(%r1),%dp
+
 	/* Remember the lowest stack address. */
 	addil	LT'__libc_stack_end,%r19
 	ldw	RT'__libc_stack_end(%r1),%r20

Alan
-- 
Linuxcare