summaryrefslogtreecommitdiff
path: root/recipes/eglibc/files/armv4t-interworking.patch
blob: 6ab306180c25ff16cf89472d33c1be9a02f286f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Index: libc/ports/sysdeps/arm/memcpy.S
===================================================================
--- libc.orig/ports/sysdeps/arm/memcpy.S	2009-09-03 16:12:00.000000000 -0700
+++ libc/ports/sysdeps/arm/memcpy.S	2009-10-28 12:51:22.000000000 -0700
@@ -130,7 +130,12 @@ ENTRY(memcpy)
 		strcsb	r4, [r0], #1
 		strcsb	ip, [r0]
 
+#if defined (__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
+		ldmfd	sp!, {r0, r4, lr}
+                bx      lr
+#else
 		ldmfd	sp!, {r0, r4, pc}
+#endif
 
 9:		rsb	ip, ip, #4
 		cmp	ip, #2
Index: libc/ports/sysdeps/arm/memmove.S
===================================================================
--- libc.orig/ports/sysdeps/arm/memmove.S	2009-09-03 16:12:00.000000000 -0700
+++ libc/ports/sysdeps/arm/memmove.S	2009-10-28 12:51:22.000000000 -0700
@@ -144,7 +144,12 @@ ENTRY(memmove)
 		strneb	r3, [r0, #-1]!
 		strcsb	r4, [r0, #-1]!
 		strcsb	ip, [r0, #-1]
+#if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)
+		ldmfd	sp!, {r0, r4, lr}
+                bx      lr
+#else
 		ldmfd	sp!, {r0, r4, pc}
+#endif
 
 9:		cmp	ip, #2
 		ldrgtb	r3, [r1, #-1]!
Index: libc/ports/sysdeps/unix/sysv/linux/arm/clone.S
===================================================================
--- libc.orig/ports/sysdeps/unix/sysv/linux/arm/clone.S	2009-09-03 16:12:04.000000000 -0700
+++ libc/ports/sysdeps/unix/sysv/linux/arm/clone.S	2009-10-28 12:51:22.000000000 -0700
@@ -96,8 +96,14 @@ ENTRY(__clone)
 #endif
 	@ pick the function arg and call address off the stack and execute
 	ldr	r0, [sp, #4]
+#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
+	ldr 	ip, [sp], #8
+	mov	lr, pc
+        bx      ip
+#else
 	mov	lr, pc
 	ldr 	pc, [sp], #8
+#endif
 
 	@ and we are done, passing the return value through r0
 	b	PLTJMP(HIDDEN_JUMPTARGET(_exit))
Index: libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
===================================================================
--- libc.orig/ports/sysdeps/unix/sysv/linux/arm/sysdep.h	2009-09-16 13:58:18.000000000 +0100
+++ libc/ports/sysdeps/unix/sysv/linux/arm/sysdep.h	2009-11-03 19:17:16.000000000 +0000
@@ -129,6 +129,11 @@
        DO_RET(lr);						\
 1:     .word C_SYMBOL_NAME(rtld_errno) - 0b - 8;
 # else
+#if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
+#define POP_PC  ldr     lr, [sp], #4; bx lr
+#else
+#define POP_PC  ldr     pc, [sp], #4
+#endif
 #  define SYSCALL_ERROR_HANDLER					\
 __local_syscall_error:						\
 	str	lr, [sp, #-4]!;					\
@@ -138,7 +143,7 @@
 	rsb	r1, r1, #0;					\
 	str	r1, [r0];					\
 	mvn	r0, #0;						\
-	ldr	pc, [sp], #4;
+        POP_PC;
 # endif
 #else
 # define SYSCALL_ERROR_HANDLER	/* Nothing here; code in sysdep.S is used.  */