• 周日. 5月 4th, 2025

使用 objdump 打印 so 库的版本信息

8月 4, 2020

使用 objdump 打印 so 库的版本信息

使用用以下指令:

objdump -s  --section=.comment  xxx.so

举例如下:

seven@seven:~/$ objdump -s  --section=.comment libopencv_core.so

libopencv_core.so:     file format elf64-little

Contents of section .comment:
 0000 4743433a 20285562 756e7475 2f4c696e  GCC: (Ubuntu/Lin
 0010 61726f20 352e342e 302d3675 62756e74  aro 5.4.0-6ubunt
 0020 75317e31 362e3034 2e392920 352e342e  u1~16.04.9) 5.4.
 0030 30203230 31363036 303900             0 20160609.

以上就可以看出libopencv_core.so 是用gcc 5.4.0 ubuntu 16.04的环境编译的了。