]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 338615 suppress glibc 2.20 optimized strcmp implementation for ARMv7.
authorMark Wielaard <mark@klomp.org>
Thu, 28 Aug 2014 14:59:04 +0000 (14:59 +0000)
committerMark Wielaard <mark@klomp.org>
Thu, 28 Aug 2014 14:59:04 +0000 (14:59 +0000)
Add an add_hardwired_spec for strcmp in VG_(redir_initialise) for
ld-linux.so.3 and ld-linux-armhf.so.3 to use a simple strcmp
implementation in m_trampoline.S (compiled from the trivial .c code
to asm with gcc like the other implementations in that file).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14374

NEWS
coregrind/m_redir.c
coregrind/m_trampoline.S
coregrind/pub_core_trampoline.h

diff --git a/NEWS b/NEWS
index 2078d006fd5540ce3c8fd50ad7c2144e9dd47414..ca9973e0a0e6f6ca37bdea8a06e2c7f8712e05be 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -216,6 +216,7 @@ where XXXXXX is the bug number as listed below.
 338205  configure.ac and check for -Wno-tautological-compare
 338445  amd64 vbit-test fails with unknown opcodes used by arm64 VEX
 338499  --sim-hints parsing broken due to wrong order in tokens
+338615  suppress glibc 2.20 optimized strcmp implementation for ARMv7
 n-i-bz  Fix KVM_CREATE_IRQCHIP ioctl handling
 n-i-bz  s390x: Fix memory corruption for multithreaded applications
 n-i-bz  vex arm->IR: allow PC as basereg in some LDRD cases
index 1fb3df29614e59080382f0afbb97ca83034d8027..374b796bbc4b2fd3c6a873a08f6464735875cb62 100644 (file)
@@ -1388,6 +1388,17 @@ void VG_(redir_initialise) ( void )
          (Addr)&VG_(arm_linux_REDIR_FOR_memcpy),
          complain_about_stripped_glibc_ldso
       );
+      /* strcmp */
+      add_hardwired_spec(
+         "ld-linux.so.3", "strcmp",
+         (Addr)&VG_(arm_linux_REDIR_FOR_strcmp),
+         complain_about_stripped_glibc_ldso
+      );
+      add_hardwired_spec(
+         "ld-linux-armhf.so.3", "strcmp",
+         (Addr)&VG_(arm_linux_REDIR_FOR_strcmp),
+         complain_about_stripped_glibc_ldso
+      );
    }
 
 #  elif defined(VGP_arm64_linux)
index 23941007fa23dc85f43ecaec2d6f2676f86b63e4..81a1b1e57a522ed4fea59746462c880e85a3c8b0 100644 (file)
@@ -700,6 +700,22 @@ VG_(arm_linux_REDIR_FOR_memcpy):
        ldmfd   sp!, {r4, r5, pc}
        UD2_4
 
+.global VG_(arm_linux_REDIR_FOR_strcmp)
+VG_(arm_linux_REDIR_FOR_strcmp):
+.L64:
+       ldrb    r3, [r0], #1    @ zero_extendqisi2
+       ldrb    r2, [r1], #1    @ zero_extendqisi2
+       cmp     r3, #0
+       beq     .L67
+       cmp     r3, r2
+       beq     .L64
+       rsb     r0, r2, r3
+       bx      lr
+.L67:
+       rsb     r0, r2, #0
+       bx      lr
+       UD2_4
+
 .global VG_(trampoline_stuff_end)
 VG_(trampoline_stuff_end):
 
index b4c056bd46048877cd3fd258ec42f3f60cd7b340..51dbc13c73d226434e3cbe53da1c190c6c600a02 100644 (file)
@@ -101,6 +101,7 @@ extern Addr  VG_(arm_linux_SUBST_FOR_rt_sigreturn);
 extern UInt  VG_(arm_linux_REDIR_FOR_strlen)( void* );
 //extern void* VG_(arm_linux_REDIR_FOR_index) ( void*, Int );
 extern void* VG_(arm_linux_REDIR_FOR_memcpy)( void*, void*, Int );
+extern void* VG_(arm_linux_REDIR_FOR_strcmp)( void*, void* );
 #endif
 
 #if defined(VGP_arm64_linux)