Created
January 8, 2015 18:06
-
-
Save greyfade/65ea6cd616fa9d656b23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
/* force memcpy from old glibc for compatibility */ | |
#ifdef __amd64__ | |
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5"); | |
#else | |
__asm__(".symver memcpy,memcpy@GLIBC_2.0"); | |
#endif /*__amd64__*/ | |
void *__wrap_memcpy(void *dest, const void *src, size_t n) | |
{ | |
return memcpy(dest, src, n); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add "
-Wl,--wrap=memcpy
" to your linker flags to enable this hack. Repeat for all affected functions.Use
objdump -T <executable> | grep GLIBC_
to find affected symbols.