To display the size and other information about the binary object sections of a program on a Linux system, you can use the readelf
command with the -S
option.
For example, to display information about the sections of the ls
command, you can use the following command:
readelf -S /bin/lsSource:www.lautturi.com
This will display a list of all sections in the ls
binary, along with their sizes and other information.
To display only the size of the text and data segments, you can use the -s
option along with the .text
and .data
section names. For example:
readelf -s /bin/ls | grep .text readelf -s /bin/ls | grep .data
This will display the sizes of the text and data segments in the ls
binary.