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:
for a given lib libABC, there are four files:
libABC.so
libABC.so.4
libABC.so.4.5
libABC.so.4.5.0
They are daisy-chained like this:
the first file, libABC.so, contains the following:
link libABC.so.4
whereas the next file, libABC.so.4, contains the following:
link libABC.so.4.5
and so on till the actual lib file, 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.
What could that be?
The linker script format is described in the GNU ld manual.
I found this issue myself today, and what happens is when you do a checkout using SVN on Windows (e.g. TortoiseSVN), the Linux symlink is converted into a text file.
Then, on the build process, ld is receiving a text file instead of a symlink that would lead to the concrete file.
Solution: svn checkout on the Linux machine.
精彩评论