This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

SH resolver change


Hi,

Here's a patch to sh/dl-machine.h to handle the new PLT code
generated by the newest GNU ld. It preserves the backward
compatibility.

Regards,
	kaz
--
2001-05-23  kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/sh/dl-machine.h (_dl_runtime_resolve): Handle newer PLT.
	(_dl_runtime_profile): Likewise.

Index: dl-machine.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/sh/dl-machine.h,v
retrieving revision 1.6
diff -u -r1.6 dl-machine.h
--- dl-machine.h	2001/03/06 07:30:22	1.6
+++ dl-machine.h	2001/05/23 22:09:35
@@ -165,6 +165,7 @@
 	.type _dl_runtime_resolve, @function
 	.align 5
 _dl_runtime_resolve:
+	mov.l r2,@-r15
 	mov.l r3,@-r15
 	mov.l r4,@-r15
 	mov.l r5,@-r15
@@ -175,6 +176,10 @@
 	mov.l r3,@-r15
 	" FGR_SAVE "
 	sts.l pr,@-r15
+	tst r0,r0
+	bt 1f
+	mov r0,r2
+1:
 	mov r0,r4		! PLT type
 	mov r2,r5		! link map address
 	" FUN_ADDR "
@@ -189,8 +194,9 @@
 	mov.l @r15+,r6
 	mov.l @r15+,r5
 	mov.l @r15+,r4
+	mov.l @r15+,r3
 	jmp @r0			! Jump to function address.
-	 mov.l @r15+,r3
+	 mov.l @r15+,r2
 	.align 2
 3:
 	.long " GOTJMP (fixup) "
@@ -200,6 +206,7 @@
 	.type _dl_runtime_profile, @function
 	.align 5
 _dl_runtime_profile:
+	mov.l r2,@-r15
 	mov.l r3,@-r15
 	mov.l r4,@-r15
 	mov.l r5,@-r15
@@ -210,6 +217,10 @@
 	mov.l r3,@-r15
 	" FGR_SAVE "
 	sts.l pr,@-r15
+	tst r0,r0
+	bt 1f
+	mov r0,r2
+1:
 	mov r0,r4		! PLT type
 	mov r2,r5		! link map address
 	sts pr,r7		! return address
@@ -225,8 +236,9 @@
 	mov.l @r15+,r6
 	mov.l @r15+,r5
 	mov.l @r15+,r4
+	mov.l @r15+,r3
 	jmp @r0			! Jump to function address.
-	 mov.l @r15+,r3
+	 mov.l @r15+,r2
 	.align 2
 3:
 	.long " GOTJMP (profile_fixup) "
@@ -243,6 +255,7 @@
 	.align 5
 _dl_runtime_resolve:
 _dl_runtime_profile:
+	mov.l r2,@-r15
 	mov.l r3,@-r15
 	mov.l r4,@-r15
 	mov.l r5,@-r15
@@ -253,6 +266,10 @@
 	mov.l r3,@-r15
 	" FGR_SAVE "
 	sts.l pr,@-r15
+	tst r0,r0
+	bt 1f
+	mov r0,r2
+1:
 	mov r0,r4		! PLT type
 	mov r2,r5		! link map address
 	sts pr,r7		! return address
@@ -268,8 +285,9 @@
 	mov.l @r15+,r6
 	mov.l @r15+,r5
 	mov.l @r15+,r4
+	mov.l @r15+,r3
 	jmp @r0			! Jump to function address.
-	 mov.l @r15+,r3
+	 mov.l @r15+,r2
 	.align 2
 3:
 	.long " GOTJMP (fixup) "


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]