4 ms·
How did you patch it? Just compile with "-fno-plt" or something more?
by viraptor 8y ago
How did you patch it? Just compile with "-fno-plt" or something more?
- glandium 8y agodiff --git a/hello.c b/hello.c index 725d5ec..b7b1745 100644 --- a/hello.c +++ b/hello.c @@ -1,3 +1,5 @@ +#define _GNU_SOURCE +#include <dlfcn.h> #include <stdio.h> #include "newplus/plus.h" @@ -7,8 +9,9 @@ void run(int count) long long end; int x = 0; + int (*_plusone)(int) = dlsym(RTLD_DEFAULT, "plusone"); while (x < count) - x = plusone(x); + x = _plusone(x); printf("%lld\n", current_timestamp() - start); } And you need to add -ldl to the link flags. Edit: but yeah, -fno-plt works too.