objdump 和 ARM 与 Thumb [英] objdump and ARM vs Thumb

查看:39
本文介绍了objdump 和 ARM 与 Thumb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 gcc 反汇编为 ARM 构建的对象.不幸的是,objdump 试图猜测代码是否是 ARM 和 Thumb,并且弄错了:它认为我的代码是 Thumb,而实际上它是 ARM.

I'm trying to disassemble an object built for ARM with gcc. Unfortunately, objdump is trying to guess whether the code is ARM and Thumb, and is getting it wrong: it thinks my code is Thumb when it's actually ARM.

我看到 objdump 有一个选项可以强制它将所有指令解释为 Thumb (-Mforce-thumb),但它没有一个选项来强制 ARM 模式!

I see that objdump has an option to force it to interpret all instructions as Thumb (-Mforce-thumb), but it doesn't have one to force ARM mode!

这对我来说似乎是一个非常奇怪的遗漏,它严重阻碍了我完成工作的能力(我在嵌入式设备上,我唯一的调试方法是查看反汇编).我尝试了各种方法,包括尝试告诉 objdump 使用不支持 Thumb 的 ARM 架构,但似乎没有任何效果.有什么想法吗?

This seems like a really weird omission to me, and it's seriously hampering my ability to get work done (I'm on an embedded device and my only means of debugging is to look at the disassembly). I've tried various approaches, including trying to tell objdump to use an ARM architecture that doesn't support Thumb, but nothing seems to work. Any ideas?

(是的,我知道指令确实是 ARM...)

(And yes, I know that the instructions really are ARM...)

推荐答案

arm-linux-gnueabi-objdump -marm -b binary -D 对我有用.虽然它不保留符号信息,因此它不是您要查找的内容,但它为您提供了反汇编,这是一个开始.

arm-linux-gnueabi-objdump -marm -b binary -D does the trick for me. It doesn't preserve the symbol information though, so it's not quite what you are looking for, but it gives you the disassemble, which is a start.

这篇关于objdump 和 ARM 与 Thumb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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