我已经在32位计算机上构建了OpenSSL库,这是文件的格式:
$ file /home/amy/ssl/lib/libcrypto.so.1.0.0
/home/amy/ssl/lib/libcrypto.so.1.0.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=98127fe038c1ee9e61b7ad7650cf1f8be7168058, not stripped
很明显,这是一个32位库。
我的操作系统版本如下所示:
$ uname -ra
Linux ubuntu32 4.15.0-65-generic #74~16.04.1-Ubuntu SMP Wed Sep 18 09:52:05 UTC 2019 i686 i686 i686 GNU/Linux
我的错误是:
*** Linking Stage
/home/amy/ssl/lib/libcrypto.so.1.0.0: could not read symbols: File in wrong format
collect2: error: ld returned 1 exit status
显示了我的编译器和链接器格式:
$ file /home/amy/arm-linux-gcc-4.9.1-glibc-2.19/x-tools/arm-aspeed-linux-gnueabi/bin/arm-aspeed-linux-gnueabi-gcc-4.9.1
/home/amy/arm-linux-gcc-4.9.1-glibc-2.19/x-tools/arm-aspeed-linux-gnueabi/bin/arm-aspeed-linux-gnueabi-gcc-4.9.1: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib, for GNU/Linux 2.6.24, BuildID[sha1]=b9380d0235052cfc8b364dc1e98e315602830776, stripped
$ file /home/amy/arm-linux-gcc-4.9.1-glibc-2.19/x-tools/arm-aspeed-linux-gnueabi/bin/arm-aspeed-linux-gnueabi-ld
/home/amy/arm-linux-gcc-4.9.1-glibc-2.19/x-tools/arm-aspeed-linux-gnueabi/bin/arm-aspeed-linux-gnueabi-ld: POSIX shell script, ASCII text executable
根据我在线上的说法,当32位和64位文件不匹配时,会发生文件格式错误。但就我而言,都是32位。任何人都可以提出其他可能导致我看到此错误的原因的建议吗?