From: Julian Seward Date: Sat, 15 Oct 2005 02:00:41 +0000 (+0000) Subject: Various fixes to reduce noise level on SuSE 10 (PPC). Also fix some X-Git-Tag: svn/VALGRIND_3_1_0~305 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04bb445744b99648f4d6ed9c43a968f934b748db;p=thirdparty%2Fvalgrind.git Various fixes to reduce noise level on SuSE 10 (PPC). Also fix some ppc32 syscalls. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4927 --- diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c index 493125862a..0590233402 100644 --- a/coregrind/m_redir.c +++ b/coregrind/m_redir.c @@ -375,6 +375,10 @@ void VG_(setup_code_redirect_table) ( void ) "soname:ld.so.1", "strcmp", (Addr)&VG_(ppc32_linux_REDIR_FOR_strcmp) ); + add_redirect_sym_to_addr( + "soname:ld.so.1", "index", + (Addr)&VG_(ppc32_linux_REDIR_FOR_strchr) + ); #else # error Unknown platform diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c index d3013354f8..b8dad4170a 100644 --- a/coregrind/m_syswrap/syswrap-ppc32-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c @@ -1825,11 +1825,11 @@ const SyscallTableEntry ML_(syscall_table)[] = { //.. // (__NR_sysfs, sys_sysfs), // 135 SVr4 //.. LINX_(__NR_personality, sys_personality), // 136 //.. GENX_(__NR_afs_syscall, sys_ni_syscall), // 137 -//.. LINX_(__NR_setfsuid, sys_setfsuid16), // 138 -//.. LINX_(__NR_setfsgid, sys_setfsgid16), // 139 -//.. + LINX_(__NR_setfsuid, sys_setfsuid16), // 138 + LINX_(__NR_setfsgid, sys_setfsgid16), // 139 + LINXY(__NR__llseek, sys_llseek), // 140 -//.. GENXY(__NR_getdents, sys_getdents), // 141 + GENXY(__NR_getdents, sys_getdents), // 141 GENX_(__NR__newselect, sys_select), // 142 GENX_(__NR_flock, sys_flock), // 143 //.. GENX_(__NR_msync, sys_msync), // 144 diff --git a/coregrind/m_trampoline.S b/coregrind/m_trampoline.S index 3477a54e17..54a6a76d6a 100644 --- a/coregrind/m_trampoline.S +++ b/coregrind/m_trampoline.S @@ -209,6 +209,29 @@ VG_(ppc32_linux_REDIR_FOR_strcmp): blr .size VG_(ppc32_linux_REDIR_FOR_strcmp), .-VG_(ppc32_linux_REDIR_FOR_strcmp) +/* Ditto index/strchr */ +.global VG_(ppc32_linux_REDIR_FOR_strchr) +.type VG_(ppc32_linux_REDIR_FOR_strchr), @function +VG_(ppc32_linux_REDIR_FOR_strchr): + lbz 0,0(3) + cmpw 7,4,0 + beqlr 7 + cmpwi 7,0,0 + beq 7,.L307 + .p2align 4,,15 +.L310: + lbzu 0,1(3) + cmpw 7,0,4 + cmpwi 6,0,0 + beq 7,.L313 + bne 6,.L310 +.L307: + li 3,0 + blr +.L313: + blr +.size VG_(ppc32_linux_REDIR_FOR_strchr),.-VG_(ppc32_linux_REDIR_FOR_strchr) + .global VG_(trampoline_stuff_end) VG_(trampoline_stuff_end): diff --git a/coregrind/pub_core_trampoline.h b/coregrind/pub_core_trampoline.h index 666e1482a6..95f58d4bff 100644 --- a/coregrind/pub_core_trampoline.h +++ b/coregrind/pub_core_trampoline.h @@ -60,8 +60,9 @@ extern void VG_(amd64_linux_REDIR_FOR_vtime); #endif #if defined(VGP_ppc32_linux) -extern UInt VG_(ppc32_linux_REDIR_FOR_strlen)( void* ); -extern UInt VG_(ppc32_linux_REDIR_FOR_strcmp)( void*, void* ); +extern UInt VG_(ppc32_linux_REDIR_FOR_strlen)( void* ); +extern UInt VG_(ppc32_linux_REDIR_FOR_strcmp)( void*, void* ); +extern void* VG_(ppc32_linux_REDIR_FOR_strchr)( void*, Int ); #endif #endif // __PUB_CORE_TRAMPOLINE_H diff --git a/coregrind/vki_unistd-ppc32-linux.h b/coregrind/vki_unistd-ppc32-linux.h index fd9e292394..d43f69cda7 100644 --- a/coregrind/vki_unistd-ppc32-linux.h +++ b/coregrind/vki_unistd-ppc32-linux.h @@ -167,8 +167,8 @@ //#define __NR_sysfs 135 //#define __NR_personality 136 //#define __NR_afs_syscall 137 /* Syscall for Andrew File System */ -//#define __NR_setfsuid 138 -//#define __NR_setfsgid 139 +#define __NR_setfsuid 138 +#define __NR_setfsgid 139 #define __NR__llseek 140 #define __NR_getdents 141 #define __NR__newselect 142 diff --git a/glibc-2.3.supp b/glibc-2.3.supp index cea67318de..eb7fc2cb4d 100644 --- a/glibc-2.3.supp +++ b/glibc-2.3.supp @@ -418,6 +418,18 @@ #} +##----------------------------------------------------------------------## +## glibc-2.3.5 on SuSE 10.0 (PPC) +# +# I don't know why this is needed, but still: +{ + glibc-2.3.5-on-SuSE-10.0-(PPC)-1 + Memcheck:Cond + fun:_dl_start + fun:_start +} + + ##----------------------------------------------------------------------## # Hacks pertaining to the fact that our intercept mechanism can't # always get hold of strlen early enough, due to idiocy in the low