LD_PRELOAD not working
Hi,
I'm trying to create my own version of the printf function. I'm using the following code: Code:
#ifndef _GNU_SOURCE Code:
$ gcc -shared -o libprinthack.so printhack.o -ldl Code:
Code:
$ LD_PRELOAD=$PWD/libprinthack.so ./test |
Set LD_DEBUG to 'all' and see the output.
|
Yeah, gcc is being [un]helpful and changing your printf() to a puts().
You'll need to overload puts as well. |
Or you could build the hosting app with -fno-builtin-printf, but that kind of defeats most of the point of LD_PRELOAD..
|
All times are GMT -5. The time now is 03:19 AM. |