During embedded development, we compile a *. s file and finally generate the binfile. The compilation command is roughly as follows:
Cc = arm-softfloat-Linux-GNU-gcc
LD = arm-softfloat-Linux-GNU-LD
Objcopy = arm-softfloat-Linux-GNU-objcopy
$ (CC)-G $ (cflag)-C boot. s # first generate the boot. s file to boot. o
$ (LD)-g-bstatic-T $ (ldfile)-ttext 0x12345600 boot. O -- start-group-map boot. map-O boot. elf # restart boot. O generate boot. elf, boot. ELF is usually an executable file, similar to GCC-O test. in C, enter the test file in Linux Shell. /test.
$ (Objcopy)-O binary boot. Elf boot. Bin # Run boot. Elf-> boot. bin to reduce the code size.
Run arm-softfloat-Linux-GNU-objdump-H boot. Elf to view the file information.
Arm-softfloat-Linux-GNU-objdump-H boot. Bin will prompt an error. To view the boot. binfile information, enter:
Arm-softfloat-Linux-GNU-objdump-H-B Binary-M arm boot. Bin. Haha, I also learned a trick. The parameter-h can be replaced with-D,-S,-S, and so on, use the meaning in arm-softfloat-Linux-GNU-objdump -- Help Viewer.
Differences between Elf bin files:
We have a Linux OS. To run executable files, they follow the ELF format, usually gcc-O test. c. The generated test file is in ELF format, so that you can run it.
The arm-softfloat-Linux-GNU-objcopy command removes the ELF format and only keeps the most pure assembly (I don't know how to explain it ),
In embedded, if the system does not have an operating system when it is powered on, if the ELF format file is burned in and contains some ELF format files, arm runs these commands, this will cause a failure. If you use arm-softfloat-Linux-GNU-objcopy to generate a pure assembly, the program can be run step by step.