Blame SOURCES/valgrind-3.13.0-arm-index-hardwire.patch

1af9e5
diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c
1af9e5
index b8cc022..d54cae7 100644
1af9e5
--- a/coregrind/m_redir.c
1af9e5
+++ b/coregrind/m_redir.c
1af9e5
@@ -1485,6 +1485,17 @@ void VG_(redir_initialise) ( void )
1af9e5
          (Addr)&VG_(arm_linux_REDIR_FOR_strcmp),
1af9e5
          complain_about_stripped_glibc_ldso
1af9e5
       );
1af9e5
+      /* index */
1af9e5
+      add_hardwired_spec(
1af9e5
+         "ld-linux.so.3", "index",
1af9e5
+         (Addr)&VG_(arm_linux_REDIR_FOR_index),
1af9e5
+         complain_about_stripped_glibc_ldso
1af9e5
+      );
1af9e5
+      add_hardwired_spec(
1af9e5
+         "ld-linux-armhf.so.3", "index",
1af9e5
+         (Addr)&VG_(arm_linux_REDIR_FOR_index),
1af9e5
+         complain_about_stripped_glibc_ldso
1af9e5
+      );
1af9e5
    }
1af9e5
 
1af9e5
 #  elif defined(VGP_arm64_linux)
1af9e5
diff --git a/coregrind/m_trampoline.S b/coregrind/m_trampoline.S
1af9e5
index a532071..0488b54 100644
1af9e5
--- a/coregrind/m_trampoline.S
1af9e5
+++ b/coregrind/m_trampoline.S
1af9e5
@@ -625,26 +625,26 @@ VG_(arm_linux_REDIR_FOR_strlen):
1af9e5
 	bx	lr
1af9e5
 	UD2_4
1af9e5
 
1af9e5
-//.global VG_(arm_linux_REDIR_FOR_index)
1af9e5
-//VG_(arm_linux_REDIR_FOR_index):
1af9e5
-//	ldrb	r3, [r0, #0]	@ zero_extendqisi2
1af9e5
-//	and	r1, r1, #255
1af9e5
-//	cmp	r3, r1
1af9e5
-//	@ lr needed for prologue
1af9e5
-//	bne	.L9
1af9e5
-//	bx	lr
1af9e5
-//.L12:
1af9e5
-//	ldrb	r3, [r0, #1]!	@ zero_extendqisi2
1af9e5
-//	cmp	r3, r1
1af9e5
-//	beq	.L11
1af9e5
-//.L9:
1af9e5
-//	cmp	r3, #0
1af9e5
-//	bne	.L12
1af9e5
-//	mov	r0, #0
1af9e5
-//	bx	lr
1af9e5
-//.L11:
1af9e5
-//	bx	lr
1af9e5
-//	UD2_4
1af9e5
+.global VG_(arm_linux_REDIR_FOR_index)
1af9e5
+VG_(arm_linux_REDIR_FOR_index):
1af9e5
+	ldrb	r3, [r0, #0]	@ zero_extendqisi2
1af9e5
+	and	r1, r1, #255
1af9e5
+	cmp	r3, r1
1af9e5
+	@ lr needed for prologue
1af9e5
+	bne	.L9
1af9e5
+	bx	lr
1af9e5
+.L12:
1af9e5
+	ldrb	r3, [r0, #1]!	@ zero_extendqisi2
1af9e5
+	cmp	r3, r1
1af9e5
+	beq	.L11
1af9e5
+.L9:
1af9e5
+	cmp	r3, #0
1af9e5
+	bne	.L12
1af9e5
+	mov	r0, #0
1af9e5
+	bx	lr
1af9e5
+.L11:
1af9e5
+	bx	lr
1af9e5
+	UD2_4
1af9e5
 
1af9e5
 .global VG_(arm_linux_REDIR_FOR_memcpy)
1af9e5
 VG_(arm_linux_REDIR_FOR_memcpy):
1af9e5
diff --git a/coregrind/pub_core_trampoline.h b/coregrind/pub_core_trampoline.h
1af9e5
index 3a9bafe..e29427d 100644
1af9e5
--- a/coregrind/pub_core_trampoline.h
1af9e5
+++ b/coregrind/pub_core_trampoline.h
1af9e5
@@ -100,7 +100,7 @@ extern Addr VG_(ppctoc_magic_redirect_return_stub);
1af9e5
 extern Addr  VG_(arm_linux_SUBST_FOR_sigreturn);
1af9e5
 extern Addr  VG_(arm_linux_SUBST_FOR_rt_sigreturn);
1af9e5
 extern UInt  VG_(arm_linux_REDIR_FOR_strlen)( void* );
1af9e5
-//extern void* VG_(arm_linux_REDIR_FOR_index) ( void*, Int );
1af9e5
+extern void* VG_(arm_linux_REDIR_FOR_index) ( void*, Int );
1af9e5
 extern void* VG_(arm_linux_REDIR_FOR_memcpy)( void*, void*, Int );
1af9e5
 extern void* VG_(arm_linux_REDIR_FOR_strcmp)( void*, void* );
1af9e5
 #endif