[klibc] [PATCH] Fix DT_FINI function pass-in to _start on parisc

Kyle McMartin kyle at parisc-linux.org
Sun Jan 8 08:29:24 PST 2006

The PA-RISC ELF ABI puts the function pointer to be registered
with atexit in %r23. Use this instead of passing in NULL. While
it's unlikely to be used, doing the right thing is good.

Signed-off-by: Kyle McMartin <kyle at parisc-linux.org>

diff --git a/klibc/arch/parisc/crt0.S b/klibc/arch/parisc/crt0.S
index 7428443..a9b6e96 100644
--- a/klibc/arch/parisc/crt0.S
+++ b/klibc/arch/parisc/crt0.S
@@ -25,8 +25,8 @@ _start: 
 	ldil	L%$global$, %dp
 	ldo	R%$global$(%dp), %dp
-/* Indicate that we don't need no stinkin' atexit callback */
-	ldi	0,%r25
+/* parisc abi puts the atexit pointer in %r23, see ELF_PLAT_INIT() */
+	copy	%r23, %r25
 /* branch to __libc_init */
 	bl	__libc_init,%r2

More information about the klibc mailing list