ELF文件认为它的小,但它的大!不能生成的.bin和.HEX文件 [英] elf file thinks its small, but its large! can not generate .bin and .hex files
问题描述
我的工作从凯尔的一个项目迁移到GCC。
I am working on migrating a project from Kail to Gcc.
的http://www.copypaste$c$c.com/73860/ 一>
.LD文件的http://www.copypaste$c$c.com/73856/
我有一个Makefile和platform.ld脚本和一些.c和.h文件。
当我做,一切编译和链接,它看起来不错。
I have a Makefile and a platform.ld script and some .c and .h files. When i make, everything compiles and links and it looks good.
臂无 - EABI尺寸-B输出/ stm32_gps_test.elf
arm-none-eabi-size -B Output/stm32_gps_test.elf
text data bss dec hex filename
0 0 2048 2048 800 Output/stm32_gps_test.elf
但是当我检查生成的文件,我看到这一点:
but when i check the generated files i see this:
LS输出/
7327274 2011-07-02 04:28 stm32_gps_test.elf
0 2011-07-02 04:28 stm32_gps_test.bin
34 2011-07-02 04:28 stm32_gps_test.hex
和
尾输出/ stm32_gps_test.hex
tail Output/stm32_gps_test.hex
:0400000508000000EF
:00000001FF
在ELF文件的一些信息:
Some info on the elf file:
臂无 - EABI-readelf -h输出/ stm32_gps_test.elf
arm-none-eabi-readelf -h Output/stm32_gps_test.elf
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0x8000000
Start of program headers: 52 (bytes into file)
Start of section headers: 7323752 (bytes into file)
Flags: 0x5000002, has entry point, Version5 EABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 1
Size of section headers: 40 (bytes)
Number of section headers: 18
Section header string table index: 15
什么是错的?我试图运行objcopy把创建一个binfile和hexfile但结果总是一样的。
What is wrong? i have tried to run objcopy to create a binfile and hexfile but the result is always the same.
推荐答案
当你拆开它你怎么看? (objdump的-D)如果在0x20000000具有例如在0x80000000的一个ROM图像和柱塞从objcopy把.bin文件将是在最低0x60000000字节加上在ROM中的图像的大小。英特尔十六进制文件或SREC应的工作,虽然。
When you disassemble it what do you see? (objdump -D) If you have for example a rom image at 0x80000000 and ram at 0x20000000 the .bin file from objcopy will be at a minimum 0x60000000 bytes plus the size of the image in rom. The intel hex file or srec should work though.
这篇关于ELF文件认为它的小,但它的大!不能生成的.bin和.HEX文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!