- Embedded Systems Architecture
- Daniele Lacamera
- 257字
- 2021-06-25 21:55:02
Binary format conversion
Despite containing all the compiled symbols in binary format, an ELF file is prefixed with a header that contains a description of the content, and pointers to the position where the sections start within the file. All this extra information is not needed to run on an embedded target, so the ELF file produced by the linker has to be transformed into a plain binary file. A tool in the toolchain, called objcopy, converts images from one standard format to others, and what is generally done is a conversion of the ELF into a raw binary image, without altering the symbols. To transform the image from ELF to binary format, invoke:
$ arm-none-eabi-objcopy -I elf -O binary image.elf image.bin
This creates a new file, called image.bin, from the symbol contained in the original ELF executable, which can be uploaded to the target.
Even if not suitable in general for direct upload on the target with third-party tools, it is possible to load the symbols through the debugger and upload them to the flash address. The original ELF file is also useful as the target of other diagnostic tools in the GNU toolchain, such as nm and readelf, which display the symbols in each module, with their type and relative address within the binary image. Furthermore, by using the objdump tool on the final image, or even on single object files, several details about the image can be retrieved, including the visualization of the entire assembly code, using the -d disassemble option:
arm-none-eabi-objdump -d image.elf
- 嵌入式Linux開發技術
- 嵌入式操作系統(Linux篇)(微課版)
- Learning Magento 2 Administration
- 一學就會:Windows Vista應用完全自學手冊
- 從實踐中學習Kali Linux無線網絡滲透測試
- OpenSolaris設備驅動原理與開發
- RHCSARHCE 紅帽Linux認證學習指南(第7版)EX200 & EX300
- Vim 8文本處理實戰
- Kali Linux高級滲透測試(原書第3版)
- 從零開始學安裝與重裝系統
- Linux集群之美
- Linux網絡操作系統項目教程(RHEL 6.4/CentOS 6.4)(第2版)
- OpenSolaris系統管理
- 深入理解Android:卷III
- Modern Python Cookbook