简体   繁体   中英

“No symbol version section for versioned symbol”

I'm attempting to cross-compile my own shared library (libmystuff.so) against another shared library (libtheirstuff.so) that makes use of the libcurl shared library and am getting the following error:

libmystuff.so: No symbol version section for versioned symbol 
'curl_global_init@@CURL_OPENSSL_3'

Which is then followed by:

final link failed: Nonrepresentable section on output.

Going through the code that creates libtheirstuff, I can see that curl_global_init is the first reference to curl.

Doing ldd libtheirstuff.so on the target platform (arm5) shows that it can find all of the references.

What's going on here?

Edit: Here are the calls to gcc

arm-none-linux-gnueabi-gcc -fPIC -c mystuff_impl.c -o mystuff_impl.o -I/home/me/arm/include
arm-none-linux-gnueabi-gcc -shared -Wl,soname=libmystuff.so -o libmystuff.so.0.1 mystuff_impl.o -L/home/me/arm/lib -ltheirstuff

链接器获取的版本错误。

This problem ( No symbol version section for versioned symbol 'curl_global_init@@CURL_OPENSSL_3' ) also appears when you are trying to compile a binary that will work on multiple Linux distributions. You can check for the problem like this:

$ objdump -x mybinary | grep curl_global_init
0... F *UND*  0... curl_global_init@@CURL_OPENSSL_3

The solution in this case is to build on a machine where libcurl has been compiled with ./configure --disable-versioned-symbols . Binaries compiled this way will work elsewhere (including on systems which use versioned symbols). A portable binary should produce output like this (without any @ signs):

$ objdump -x mybinary | grep curl_global_init
0... F *UND*  0... curl_global_init

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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