简体   繁体   English

ld链接器脚本错误

[英]ld linker script error

The project I'm currently working on uses a bunch of dynamic libs bundled together with the source code. 我目前正在开发的项目使用了一堆与源代码捆绑在一起的动态库。 There is a subset of libs which is named as follows: 有一个lib子集,其名称如下:

for a given lib libABC, there are four files: 对于给定的lib libABC,有四个文件:

libABC.so libABC.so

libABC.so.4 libABC.so.4

libABC.so.4.5 libABC.so.4.5

libABC.so.4.5.0 libABC.so.4.5.0

They are daisy-chained like this: 它们是菊花链式的,如下所示:

the first file, libABC.so, contains the following: 第一个文件libABC.so包含以下内容:

link libABC.so.4

whereas the next file, libABC.so.4, contains the following: 而下一个文件libABC.so.4包含以下内容:

link libABC.so.4.5

and so on till the actual lib file, libABC.so.4.5.0. 等到实际的lib文件,libABC.so.4.5.0。

I know that this kind of stuff should be done using symlinks, but we can't change that, it's a commercial project. 我知道这种东西应该使用符号链接来完成,但我们无法改变它,这是一个商业项目。 So the linker chokes on that! 因此,链接器对此感到窒息!

/usr/bin/ld: path/to/the/packaged/libs/libABC.so:unrecognized file format, treating as linker script

(which it actually is, heh) (它实际上是,嘿)

/usr/bin/ld: path/to/the/packaged/libs/libABC.so:1:syntax error

Now I can't seem to find any info on the GNU ld linker script command "link" or any complete reference to the GNU ld linker script commands. 现在我似乎无法找到有关GNU ld链接器脚本命令“link”的任何信息或对GNU ld链接器脚本命令的任何完整引用。

What could that be? 那可能是什么?

I found this issue myself today, and what happens is when you do a checkout using SVN on Windows (eg TortoiseSVN), the Linux symlink is converted into a text file. 我今天自己发现了这个问题,发生的事情是当您在Windows上使用SVN(例如TortoiseSVN)进行结帐时,Linux符号链接被转换为文本文件。

Then, on the build process, ld is receiving a text file instead of a symlink that would lead to the concrete file. 然后,在构建过程中,ld正在接收文本文件而不是将导致具体文件的符号链接。

Solution: svn checkout on the Linux machine. 解决方案:Linux机器上的svn checkout。

GNU ld手册中描述了链接描述文件格式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM