工具来分析ELF节和符号的大小 [英] Tool to analyze size of ELF sections and symbol

查看:571
本文介绍了工具来分析ELF节和符号的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种方法来分析我的GCC编译器ARM的输出文件。我编译裸机和我很关心的大小。我可以使用臂无 - EABI-objdump的通过交叉编译提供,但分析其输出结果是不是我会迫不及待地做,如果存在这个任务的工具。你知不知道这样存在的工具?我的搜索变成了没有结果。

I need a way to analyze output file of my GCC compiler for ARM. I am compiling for bare metal and I am quite concerned with size. I can use arm-none-eabi-objdump provided by the cross-compiler but parsing the output is not something I would be eager to do if there exists a tool for this task. Do you know of such a tool existing? My search turned out no results.

还有一件事,在我自己的code每一个功能是在自己的一节。

One more thing, every function in my own code is in its own section.

推荐答案

您可以使用纳米尺寸来得到的功能和ELF节的大小。

You can use nm and size to get the size of functions and ELF sections.

要获得的函数的大小(与静态存储持续时间对象):

To get the size of the functions (and objects with static storage duration):

$ nm --print-size --size-sort --radix=d tst.o

第二列显示在功能和对象的小数的大小。

The second column shows the size in decimal of function and objects.

要获得部分的尺寸:

$ size -A -d tst.o

第二列显示了部分小数的大小。

The second column shows the size in decimal of the sections.

这篇关于工具来分析ELF节和符号的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆