Linux 静态库版本,Linux-linux下如何查看静态库是用什么gcc版本编译的

那是不可能的,除非你加入了调试信息,也就是编译的时候加入了-g参数,然后用gdb调试就可以显示。最大程度上查看一个elf文件信息。

如下所示:

$ cat a.c

int main(void){ return 0; }

$ gcc a.c

$ readelf -wi a.out

$ gcc a.c -g

$ readelf -wi a.out

Contents of the .debug_info section:

Compilation Unit @ offset 0x0:

Length: 0x42 (32-bit)

Version: 2

Abbrev Offset: 0

Pointer Size: 4

<0>: Abbrev Number: 1 (DW_TAG_compile_unit)

< c> DW_AT_producer : (indirect string, offset: 0x0): GNU C 4.4.3 20100108 (prerelease)

<10> DW_AT_language : 1 (ANSI C)

<11> DW_AT_name : a.c

<15> DW_AT_comp_dir : (indirect string, offset: 0x22): /tmp

<19> DW_AT_low_pc : 0x8048394

<1d> DW_AT_high_pc : 0x804839e

<21> DW_AT_stmt_list : 0x0

<1><25>: Abbrev Number: 2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值