rpms/valgrind/F-11 valgrind-3.4.1-x86_64-ldso-strlen.patch, NONE, 1.1 valgrind.spec, 1.62, 1.63

Jakub Jelinek jakub at fedoraproject.org
Wed Apr 22 14:48:03 UTC 2009


Author: jakub

Update of /cvs/pkgs/rpms/valgrind/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29618

Modified Files:
	valgrind.spec 
Added Files:
	valgrind-3.4.1-x86_64-ldso-strlen.patch 
Log Message:
3.4.1-2

valgrind-3.4.1-x86_64-ldso-strlen.patch:

--- NEW FILE valgrind-3.4.1-x86_64-ldso-strlen.patch ---
--- valgrind/coregrind/pub_core_trampoline.h.jj	2009-04-22 12:10:54.000000000 +0200
+++ valgrind/coregrind/pub_core_trampoline.h	2009-04-22 14:50:39.000000000 +0200
@@ -66,6 +66,7 @@ extern Char* VG_(x86_linux_REDIR_FOR_ind
 extern void VG_(amd64_linux_SUBST_FOR_rt_sigreturn);
 extern void VG_(amd64_linux_REDIR_FOR_vgettimeofday);
 extern void VG_(amd64_linux_REDIR_FOR_vtime);
+extern UInt VG_(amd64_linux_REDIR_FOR_strlen)( void* );
 #endif
 
 #if defined(VGP_ppc32_linux)
--- valgrind/coregrind/m_redir.c.jj	2009-04-22 12:10:54.000000000 +0200
+++ valgrind/coregrind/m_redir.c	2009-04-22 15:32:19.000000000 +0200
@@ -879,6 +879,20 @@ void VG_(redir_initialise) ( void )
       (Addr)&VG_(amd64_linux_REDIR_FOR_vtime) 
    );
 
+   /* If we're using memcheck, use these intercepts right from
+      the start, otherwise ld.so makes a lot of noise. */
+   if (0==VG_(strcmp)("Memcheck", VG_(details).name)) {
+
+      static const HChar croakage[]
+        = "Possible fix: install glibc's debuginfo package on this machine.";
+
+      /* this is mandatory - can't sanely continue without it */
+      add_hardwired_spec(
+         "ld-linux-x86-64.so.2", "strlen",
+         (Addr)&VG_(amd64_linux_REDIR_FOR_strlen),
+         croakage
+      );   
+   }
 #  elif defined(VGP_ppc32_linux)
    {
    static const HChar croakage[]
--- valgrind/coregrind/m_trampoline.S.jj	2009-04-22 12:10:54.000000000 +0200
+++ valgrind/coregrind/m_trampoline.S	2009-04-22 15:18:37.000000000 +0200
@@ -174,7 +174,29 @@ VG_(amd64_linux_REDIR_FOR_vtime):
 .LfnE3:
 .size VG_(amd64_linux_REDIR_FOR_vtime), .-.LfnB3
 
-/* A CIE for the above two functions, followed by their FDEs */
+/* There's no particular reason that this needs to be handwritten
+   assembly, but since that's what this file contains, here's a
+   simple strlen implementation (written in C and compiled by gcc.)
+*/
+.global VG_(amd64_linux_REDIR_FOR_strlen)
+.type   VG_(amd64_linux_REDIR_FOR_strlen), @function
+VG_(amd64_linux_REDIR_FOR_strlen):
+.LfnB4:
+	xorl	%eax, %eax
+	cmpb	$0, (%rdi)
+	movq	%rdi, %rdx
+	je	.L41
+.L40:	addq	$1, %rdx
+	cmpb	$0, (%rdx)
+	jne	.L40
+	movq	%rdx, %rax
+	subq	%rdi, %rax
+.L41:	ret
+.LfnE4:
+.size VG_(amd64_linux_REDIR_FOR_strlen), .-VG_(amd64_linux_REDIR_FOR_strlen)
+
+
+/* A CIE for the above three functions, followed by their FDEs */
 	.section .eh_frame,"a", at progbits
 .Lframe1:
         .long   .LEcie1-.LScie1
@@ -212,6 +234,15 @@ VG_(amd64_linux_REDIR_FOR_vtime):
         .uleb128 0x0
         .align 8
 .LEfde3:
+.LSfde4:
+        .long   .LEfde4-.LASfde4
+.LASfde4:
+        .long   .LASfde4-.Lframe1
+        .long   .LfnB4
+        .long   .LfnE4-.LfnB4
+        .uleb128 0x0
+        .align 8
+.LEfde4:
 	.previous
 
 .global VG_(trampoline_stuff_end)


Index: valgrind.spec
===================================================================
RCS file: /cvs/pkgs/rpms/valgrind/F-11/valgrind.spec,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- valgrind.spec	9 Mar 2009 12:50:44 -0000	1.62
+++ valgrind.spec	22 Apr 2009 14:48:00 -0000	1.63
@@ -1,11 +1,12 @@
 Summary: Tool for finding memory management bugs in programs
 Name: valgrind
 Version: 3.4.1
-Release: 1
+Release: 2
 Epoch: 1
 Source0: http://www.valgrind.org/downloads/valgrind-%{version}.tar.bz2
 Patch1: valgrind-3.4.1-cachegrind-improvements.patch
 Patch2: valgrind-3.4.1-openat.patch
+Patch3: valgrind-3.4.1-x86_64-ldso-strlen.patch
 License: GPLv2
 URL: http://www.valgrind.org/
 Group: Development/Debuggers
@@ -61,6 +62,7 @@
 %setup -q
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
 %ifarch x86_64 ppc64
@@ -151,6 +153,9 @@
 %{_libdir}/pkgconfig/*
 
 %changelog
+* Wed Apr 22 2009 Jakub Jelinek <jakub at redhat.com> 3.4.1-2
+- redirect x86_64 ld.so strlen early (#495645)
+
 * Mon Mar  9 2009 Jakub Jelinek <jakub at redhat.com> 3.4.1-1
 - update to 3.4.1
 




More information about the fedora-extras-commits mailing list