232Chapter7 • Miscellaneous Tools
[root@boota]# file ftp
ftp: ELF 32-bit LSB executable, Intel 80386, version 1,
statically linked, not stripped
[root@boota]#
[root@boota make]# file ftp.S
ftp.S: Motorola S-Record; binary data in text format
[root@boota]#
The S-record file is in ASCII hex format and first few lines can be displayed using head
command as shown below:
[root@boota]# head ftp.S
S00800006674702E532C
S31508048094040000001000000001000000474E5500CB
S315080480A400000000020000000200000005000000B1
S315080480B45589E583EC08E84500000090E8DB0000F0
S30D080480C400E836610400C9C393
S315080480E031ED5E89E183E4F05054526880E2080871
S315080480F068B4800408515668E0810408E80B010056
S3150804810000F489F65589E55350E8000000005B81C0
S31508048110C3826C05008B830C00000085C07402FFC3
S31508048120D08B5DFCC9C389F69090909090909090FE
[root@boota]#
The following command creates a binary image of the
ftp
file. The binary output is a
memory image of the executable and all symbols are removed.
objcopy -O binary ftp ftp.bin
Here is how you display a type of the new binary file.
[root@boota]# file ftp.bin
ftp.bin: X11 SNF font data, LSB first
[root@boota]#
It is a good idea to strip object files before converting them to S-record or binary files.
Start addresses can be set using the command line options
--set-start
and
--adjust-
start
.
7.7.6Using the objdump Utility
The
objdump
command displays information about an object file. It can also be used to
disassemble an object file. You can use different command line options to display particular
information about an object file.
7.7.6.1Displaying Header Information
The following command displays the header information of the binary file
a.out
.
[root@boota]# objdump -f a.out
Next Page >>
<< Previous Page
Back to the Table of Contents