Created
January 27, 2018 13:25
-
-
Save wheybags/b7e4152daf76c72503e9e1f52f3dca3d 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
[monolith] ~/test_programs > | |
$ cat implicit_memcpy.c | |
struct a | |
{ | |
int x[1024]; | |
}; | |
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5"); | |
void foo(struct a*restrict d, const struct a*restrict s, int len) | |
{ | |
for(int i = 0; i < len; i++) | |
d[i] = s[i]; | |
} | |
[monolith] ~/test_programs > | |
$ gcc -fPIC -shared implicit_memcpy.c -O3 && readelf -Ws a.out | grep memcpy | |
1: 0000000000000000 0 FUNC GLOBAL DEFAULT UND memcpy@GLIBC_2.2.5 (2) | |
31: 0000000000000000 0 FILE LOCAL DEFAULT ABS implicit_memcpy.c | |
40: 0000000000000000 0 FUNC GLOBAL DEFAULT UND memcpy@GLIBC_2.2.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment