My issue originated with a shared library I was given without the option to recompile the library. The error stated undefined reference to memcpy@GLIBC_2.14
.
The version of GLIBC on my machine was 2.12. I have seen fixes people have done online using the line
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
The fix I made was using a hex editor to change the reference of 2.14 to GLIBC_2.2.5. When executing the command readelf -V lib_name.so
, the outputs changed from:
0x0060 Name: GLIBC_2.14 Flags: none Version 6
......
0x0080 Name: GLIBC_2.2.5 Flags: none Version 4
to:
0x0060 Name: GLIBC_2.2.5 Flags: none Version 6
......
0x0080 Name: GLIBC_2.2.5 Flags: none Version 4
This fixed my error. What I want to know is what effects this will have. I have attempted to research memcpy vs. memmove and the change to memcpy starting in GLIBC_2.14, but I do not quite understand what is going on and what the original problem with memcpy was. I am worried about this "fix", although it allows my program to run, in case whatever memcpy is doing is not behaving correctly. Why do all the fixes I have seen online specifically link to the version 2.2.5?
I would appreciate if anyone could give me some insight on this topic or provide some links with relevant info.