Subject: None
To: None <port-sparc@netbsd.org>
From: Charles M. Hannum <abuse@spamalicious.com>
List: port-sparc
Date: 09/25/2002 08:27:33
Can anyone explain why the _rtld_bind_start() stub creates a second
stack frame (the PLT slot having already created one)?  AFAICT,
removing it works just fine.


Index: arch/sparc/rtld_start.S
===================================================================
RCS file: /cvsroot/basesrc/libexec/ld.elf_so/arch/sparc/rtld_start.S,v
retrieving revision 1.9
diff -u -r1.9 rtld_start.S
--- arch/sparc/rtld_start.S	2002/09/12 17:18:41	1.9
+++ arch/sparc/rtld_start.S	2002/09/25 08:31:58
@@ -80,14 +80,11 @@
 	.global	_rtld_bind_start
 	.type	_rtld_bind_start,@function
 _rtld_bind_start:	# (obj, reloff)
-	save	%sp, -96, %sp		/* setup standard stack frame */
-	ld	[%i7 + 8], %o0		/* obj id is in second PLT slot */
+	ld	[%o7 + 8], %o0		/* obj id is in second PLT slot */
 	srl	%g1, 10, %o1		/* offset is in high 22 bits */
 	call	_rtld_bind		/* Call _rtld_bind(obj, offset) */
 	 sub	%o1, 12*4, %o1		/* first 4 `pltrel' entries missing! */
 
-	mov	%o0, %g1		/* return value == function address */
-	restore				/* get rid of our context */
-	 jmp	%g1			/* and the jmpslot context, then go. */
-	restore
+	jmp	%o0			/* return value == function address */
+	 restore