我有一个二进制可执行文件“foo”。在unix中使用C程序,是否可以检索文件foo的代码和数据区域的大小?
最佳答案
您可以使用size
为此的命令。
男人尺寸
The GNU size utility lists the section sizes and the total size for each of the object or archive files objfile in its argument list. By default, one line of output is generated for each object file or each module in an archive.
示例:
$ size a.out
text data bss dec hex filename
1863 288 8 2159 86f a.out
关于c++ - 获取二进制文件的数据和代码区域的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17070225/