确定Linux中二进制文件(库或可执行文件)的目标ISA扩展 [英] Determine target ISA extensions of binary file in Linux (library or executable)

查看:196
本文介绍了确定Linux中二进制文件(库或可执行文件)的目标ISA扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们遇到一个与Java应用程序相关的问题,该Java应用程序在具有Via C3处理器的Advantech POS板上的(相当旧的)FC3下运行. Java应用程序具有几个可通过JNI访问的已编译共享库.

We have an issue related to a Java application running under a (rather old) FC3 on an Advantech POS board with a Via C3 processor. The java application has several compiled shared libs that are accessed via JNI.

通过C3处理器应该与i686兼容.前一段时间,在具有相同处理器的MiniItx板上安装Ubuntu 6.10之后,我发现前面的陈述不是100%正确.由于缺少C3处理器中i686设置的某些特定和可选指令,Ubuntu内核在启动时挂起.在使用i686优化时,GCC编译器默认使用i686集合的C3实现中缺少的这些指令.在这种情况下,解决方案是使用i386编译版本的Ubuntu发行版.

Via C3 processor is supposed to be i686 compatible. Some time ago after installing Ubuntu 6.10 on a MiniItx board with the same processor, I found out that the previous statement is not 100% true. The Ubuntu kernel hanged on startup due to the lack of some specific and optional instructions of the i686 set in the C3 processor. These instructions missing in C3 implementation of i686 set are used by default by GCC compiler when using i686 optimizations. The solution, in this case, was to go with an i386 compiled version of Ubuntu distribution.

Java应用程序的基本问题是,通过从另一台PC(这次是Intel P4)的HD映像中进行克隆,将FC3发行版安装在HD上.之后,该发行版需要进行一些修改才能使其运行,例如用i386编译版本替换某些软件包(例如内核).

The base problem with the Java application is that the FC3 distribution was installed on the HD by cloning from an image of the HD of another PC, this time an Intel P4. Afterwards, the distribution needed some hacking to have it running such as replacing some packages (such as the kernel one) with the i386 compiled version.

问题是工作了一段时间后,系统完全挂起,没有任何痕迹.恐怕某些i686代码会留在系统中的某个位置,并且可以随时随机执行(例如,从挂起模式恢复之类的东西之后).

The problem is that after working for a while the system completely hangs without a trace. I am afraid that some i686 code is left somewhere in the system and could be executed randomly at any time (for example after recovering from suspend mode or something like that).

我的问题是:

  • 是否有任何工具或方法可以找出二进制文件(可执行文件或库文件)对特定体系结构扩展的要求? file没有提供足够的信息.
  • Is there any tool or way to find out at what specific architecture extensions a binary file (executable or library) requires? file does not give enough information.

推荐答案

我认为您需要一个工具来检查每条指令,以准确确定该指令属于哪个指令集. C3处理器实现的特定指令集甚至没有正式名称吗?如果没有的话,它甚至更毛.

I think you need a tool that checks every instruction, to determine exactly which set it belongs to. Is there even an offical name for the specific set of instructions implemented by the C3 processor? If not, it's even hairier.

如果您可以确定不允许的指令的位模式,则可能会在文件中进行原始搜索,这是一种快速的'n'dirty变体.例如,只需直接测试即可,可以通过简单的objdump | grep链来完成.

A quick'n'dirty variant might be to do a raw search in the file, if you can determine the bit pattern of the disallowed instructions. Just test for them directly, could be done by a simple objdump | grep chain, for instance.

这篇关于确定Linux中二进制文件(库或可执行文件)的目标ISA扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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