如何从Linux*享库的符号依赖表中删除符号版本信息?(复制)

时间:2022-09-30 03:12:52

This question already has an answer here:

这个问题已经有了答案:

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.

我需要一种方法来带(或更改,如果剥离是不可能的)符号象征依赖表的版本信息共享库在Linux中,所以我可以工作在memcpy@GLIBC_2.14灾难,所以我可以让我的二进制文件工作种含义与glibc 2.14以上。

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.

注意:__asm__(“.symver”)指令对我不起作用,因为问题不是我的库使用了memcpy,而是我的库使用了libgcc的一些东西,并且使用了memcpy@GLIBC_2.14,这就是为什么我需要一个工具在编译之后修改它。谢谢。

1 个解决方案

#1


2  

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,

我需要一种方法从Linux*享库的符号依赖表中剥离(或者更改,如果无法剥离的话)符号版本信息,这样我就可以处理memcpy@GLIBC_2.14灾难,

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.
  • (即使您成功了)将不会生成一个二进制文件来处理旧的GLIBC。

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

所以我可以让我的二进制文件在Linuxes上使用的glibc再次大于2。14。

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

您可以在这里找到“在新系统上构建,在旧系统上运行”的方法。

#1


2  

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,

我需要一种方法从Linux*享库的符号依赖表中剥离(或者更改,如果无法剥离的话)符号版本信息,这样我就可以处理memcpy@GLIBC_2.14灾难,

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.
  • (即使您成功了)将不会生成一个二进制文件来处理旧的GLIBC。

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

所以我可以让我的二进制文件在Linuxes上使用的glibc再次大于2。14。

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

您可以在这里找到“在新系统上构建,在旧系统上运行”的方法。