Is there a utility for editing the symbol version in a compiled binary (executable or shared library)?
For example, if I have
> nm a.out
...
U powf@@GLIBC_2.27
I would like to change it to
> nm a.out
...
U powf@GLIBC_2.2.5
I'm able to make this version change by adding
__asm__(".symver powf,powf@GLIBC_2.2.5");
to a source file, but I want to do this for binaries that are already compiled.
Editing the binary hex almost works, but since desired symbol version is 1 character longer than the original, I can only manage to make it say
/usr/lib/libm.so.6: version `GLIBC_2.2.' not found
at runtime.
Overall, I'm attempting to make a binary compiled against glibc 2.27+ compatible with older versions of glibc, and if this method works, it would be far easier than other alternatives, e.g. compiling a custom GCC/glibc/libstdc++/dependencies toolchain.