Search code examples
linuxshared-librariesglibcmemcpy

How to strip symbol version information from the symbol dependency table of a shared library in Linux?


I need a way to strip (or change, if stripping is not possible) the symbol version information from the symbol dependency table of a shared library in Linux, so I can work around the memcpy@GLIBC_2.14 disaster, so I can make my binaries work on Linuxes with glibc older than 2.14 again.

Is there any tool for that?

Note: The __asm__('.symver') directive doesn't work for me because the problem is not that my library uses memcpy, but that my library uses something from libgcc and that uses memcpy@GLIBC_2.14, which is why I need a tool to change that after compilation. Thanks.


Solution

  • I need a way to strip (or change, if stripping is not possible) the symbol version information from the symbol dependency table of a shared library in Linux, so I can work around the memcpy@GLIBC_2.14 disaster,

    Stripping symbol version info

    • is not possible without rebuilding a lot of internal ELF structures inside the linked binary (i.e. impossible in practice) and
    • (even if you succeeded) will not produce a binary that will work on older GLIBC.

    so I can make my binaries work on Linuxes with glibc older than 2.14 again.

    You can find approaches to "build on newer system, run on older one" here.