5

I am not able to find objdump command in IBM AIX 5.1 machine. Actually I want to get the assembly instructions (disassemble) from a library generated in AIX. Linux has objdump command and solaris dis command to do this. What is the equivalent command in IBM AIX?

rashok
  • 12,790
  • 16
  • 88
  • 100
  • Related, see [How to use AIX disassembler?](https://unix.stackexchange.com/q/392111/56041) on [Unix & Linux Stack Exchange](http://unix.stackexchange.com/). – jww Sep 14 '17 at 02:43

2 Answers2

1

You can use the dis command to disassemble object files on AIX, it should come with xlc.

It may be easier to install the GNU bintools suite to just get objdump though. Its available from the AIX linux toolbox.

CoreyStup
  • 1,488
  • 13
  • 14
0

I have only part of an answer. Following up on @CoreyStup, I found the dis command in /opt/IBM/xlc/16.1.0/exe/dis (not the bin directory). But it was very recalcitrant, and seemed unwilling to print to stdout or stderr. I did find it was writing the output a filename created by replacing the .o on the command line with .s. So:

% /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

Using strings -a -n2, I was able to extract a possible usage message, but it was unclear what most of the options do, with the exception of -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
Dharman
  • 30,962
  • 25
  • 85
  • 135
Ted
  • 1,539
  • 1
  • 11
  • 6