如何从elf文件格式创建可执行十六进制 [英] How to create a executable hex from elf file format

查看:303
本文介绍了如何从elf文件格式创建可执行十六进制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对此我非常陌生,我有elf文件 input.out ,需要从中创建十六进制可执行文件。我正在使用objcopy以intel十六进制格式创建可执行文件,如下所示:

I am very very new to this, I have elf file input.out and need to create hex executable from it. I am using objcopy to create executable in intel hex format as follows

objcopy -O ihex input.out out.hex

hex包含所有部分(.interp,.note.ABI-tag等)的数据,但是我不确定可执行文件是否全部必需。只是.text部分足以创建可执行的十六进制,所以我可以按以下方式使用还是需要其他任何部分?

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. Is just .text section enough for creating executable hex so can i just use as below or any more sections are required

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

如果有什么好的参考可以理解细节,我在Goggling找不到很多。可能我不知道要搜索什么。

Also if there any good reference to understand this in detail, I couldn't find much by Goggling. Probably I don't know what to search.

推荐答案

它可以与

objcopy -O ihex input.elf output.hex

这篇关于如何从elf文件格式创建可执行十六进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆