In kthread.c there is this code that is only defined for I386 glibc, but the 
solaris port uses Solaris libc so the function does nothing. What is the 
purpose of this function and exactly what should the semantics be ?


BOb


static inline void writejump( const char *symbol, void *dest )
{
#if defined(__GLIBC__) && defined(__i386__)
    unsigned char *addr = wine_dlsym( RTLD_NEXT, symbol, NULL, 0 );

    if (!addr) return;

    /* write a relative jump at the function address */
    mprotect((void*)((unsigned int)addr & ~(getpagesize()-1)), 5, PROT_READ|
PROT_EXEC|PROT_WRITE);
    addr[0] = 0xe9;
    *(int *)(addr+1) = (unsigned char *)dest - (addr + 5);
    mprotect((void*)((unsigned int)addr & ~(getpagesize()-1)), 5, PROT_READ|
PROT_EXEC);

# ifdef HAVE_VALGRIND_MEMCHECK_H
    VALGRIND_DISCARD_TRANSLATIONS( addr, 5 );
# endif
#endif  /* __GLIBC__ && __i386__ */
}

Reply via email to