简体   繁体   English

如何从 elf 文件格式创建可执行的十六进制

[英]How to create a executable hex from elf file format

I am very very new to this, I have elf file input.out and need to create hex executable from it.我对此非常input.out ,我有 elf 文件input.out并且需要从中创建十六进制可执行文件。 I am using objcopy to create executable in intel hex format as follows我正在使用 objcopy 以英特尔十六进制格式创建可执行文件,如下所示

objcopy -O ihex input.out out.hex

by this out.hex contains data from all sections (.interp, .note.ABI-tag etc), but i am not sure if all of it is required for executable.通过这个 out.hex 包含来自所有部分(.interp、.note.ABI-tag 等)的数据,但我不确定是否所有这些都是可执行文件所必需的。 Is just .text section enough for creating executable hex so can i just use as below or any more sections are required只是 .text 部分足以创建可执行的十六进制所以我可以使用如下或需要更多部分

objcopy -j.text -O ihex input.out out.hex

Also if there any good reference to understand this in detail, I couldn't find much by Goggling.此外,如果有任何很好的参考可以详细了解这一点,我在 Goggling 中找不到太多东西。 Probably I don't know what to search.可能我不知道要搜索什么。

它可以与

objcopy -O ihex input.elf output.hex

添加 -S 将删除无用的部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM