栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何获得“ .a”文件的体系结构?

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何获得“ .a”文件的体系结构?

您还可以通过以下

ar
命令跳过命令并使用readelf:

readelf -h <archive>.a | grep 'Class|File|Machine'

[00:32:15] /usr/lib $ readelf -h libxslt.a | grep 'Class|File|Machine'File: libxslt.a(attrvt.o)  Class:       ELF32  Machine:     Intel 80386File: libxslt.a(xslt.o)  Class:       ELF32  Machine:     Intel 80386... #Trimmed this, it goes on a bitFile: libxslt.a(transform.o)  Class:       ELF32  Machine:     Intel 80386File: libxslt.a(security.o)  Class:       ELF32  Machine:     Intel 80386[00:32:24] /usr/lib $

如果相关,这里是您可以从中获取的其他信息

readelf -h
。我只是用修剪了以上内容
grep

File: libxslt.a(security.o)ELF Header:  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00   Class:       ELF32  data:        2's complement, little endian  Version:     1 (current)  OS/ABI:      UNIX - System V  ABI Version: 0  Type:        REL (Relocatable file)  Machine:     Intel 80386  Version:     0x1  Entry point address:    0x0  Start of program headers:          0 (bytes into file)  Start of section headers:          2548 (bytes into file)  Flags:       0x0  Size of this header:    52 (bytes)  Size of program headers:0 (bytes)  Number of program headers:         0  Size of section headers:40 (bytes)  Number of section headers:         16  Section header string table index: 13

这是输出为 一个 在目标文件

libxslt.a
,但它给每个文件相同的信息。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/405948.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号