I downloaded glibc to modify my code and then use it. So for the sake of playing with him, I changed the printf function in the stdio-common glibc directory to print "Can you see me?".
int
__printf (const char *format, ...)
{
va_list arg;
int done;
va_start (arg, format);
done = vfprintf (stdout, "Can you see me?", arg);
va_end (arg);
return done;
}
After making this change, I compiled glibc and then used LD_PRELOAD with libc.so in this glibc directory to run the sample program using printf. However, I still see printf printing normally, that is, the change I made is not reflected. What mistake am I making here?
source
share