【问题标题】:What is the equivalent command for objdump in IBM AIXIBM AIX 中 objdump 的等效命令是什么
【发布时间】:2013-05-08 22:48:42
【问题描述】:

我在 IBM AIX 5.1 机器上找不到 objdump 命令。实际上,我想从 AIX 中生成的库中获取汇编指令(反汇编)。 Linux 有 objdump 命令和 solaris dis 命令来执行此操作。 IBM AIX 中的等效命令是什么?

【问题讨论】:

标签: aix objdump


【解决方案1】:

您可以使用dis 命令在AIX 上反汇编目标文件,它应该带有xlc。

安装 GNU bintools 套件以获取 objdump 可能更容易。可从AIX linux toolbox 获得。

【讨论】:

    【解决方案2】:

    我只有部分答案。跟进@CoreyStup,我在 /opt/IBM/xlc/16.1.0/exe/dis (不是 bin 目录)中找到了 dis 命令。但它非常顽固,似乎不愿意打印到 stdout 或 stderr。我确实发现它正在输出一个通过将命令行上的 .o 替换为 .s 创建的文件名。所以:

    % /opt/IBM/xlc/16.1.0/exe/dis aix/ktraceback.o
    % ls -l aix/ktraceback.s
    -rw-r--r--    1 ota      staff         10432 Nov 19 14:01 aix/ktraceback.s
    % /opt/IBM/xlc/16.1.0/exe/dis -o /tmp/foo.s aix/ktraceback.o
    % ls /tmp/foo.s
    -rw-r--r--    1 ota      staff         10432 Nov 19 14:06 /tmp/foo.s
    

    使用字符串 -a -n2,我能够提取可能的使用消息,但不清楚大多数选项的作用,除了 -o。

    dis  disassembler  version 1.27.0.1  Nov  9 2018 08:18:36
    %s [-D] [-G] [-g] [-h] [-i] [-k] [-L] [-l] [-M] [-m <architecture>]
        [-o <file name>] [-p <level>] [-r] [-R] [-S] [-T] [-t] [ filename ]
    -D
    disassemble .data and .bss only
    -G
    do not print symbolic debugging information
    -g
    print symbolic debugging information (default)
    -H
    print BO branch hints
    -h
    print headers
    -i
    line input mode
    -k
    do not interpret traceback table
    -L
    print linker section
    -l
    print line number table
    -M
    print text maps
    -e
    print except entries
    -m
    force architecture selection:
    pwr|pwrx|pwr2|pwr2s|p2sc|com|403|601|602|603|603e|604|604e|620|
    ppc|ppcgr|ppc64|rs64a|rs64b|rs64c|pwr3|pwr4|pwr4x|pwr5|pwr5x|
    pwr6|pwr6e|pwr7|pwr8|pwr9|[ppc]970|440|440d|450|450d
    -o
    output to file
    -p
    print level
    -R
    print relative offsets (no added labels)
    -r
    print relocation table
    -S
    suppress printing symbolic definitions
    -T
    disassemble .text only
    -t
    print symbol table
    

    【讨论】:

      猜你喜欢
      • 2017-06-19
      • 2020-07-01
      • 2011-07-29
      • 2012-02-29
      • 1970-01-01
      • 1970-01-01
      • 2011-10-16
      • 2012-12-15
      • 1970-01-01
      相关资源
      最近更新 更多