4956e0e197
The bfd linker adds the symbol versioning string to the symbol name in symtab. Skip the versioning part in order to find the registered PLT function. Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei Differential Revision: https://reviews.llvm.org/D122039
21 lines
385 B
C
21 lines
385 B
C
#include "stub.h"
|
|
|
|
void *(*memcpy_p)(void *dest, const void *src, unsigned long n);
|
|
void *(*memset_p)(void *dest, int c, unsigned long n);
|
|
|
|
int main() {
|
|
int a = 0xdeadbeef, b = 0;
|
|
|
|
memcpy_p = memcpy;
|
|
memcpy_p(&b, &a, sizeof(b));
|
|
if (b != 0xdeadbeef)
|
|
return 1;
|
|
|
|
memset_p = memset;
|
|
memset_p(&a, 0, sizeof(a));
|
|
if (a != 0)
|
|
return 1;
|
|
|
|
printf("Test completed\n");
|
|
}
|