objdump.html 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1991-2017 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3
  6. or any later version published by the Free Software Foundation;
  7. with no Invariant Sections, with no Front-Cover Texts, and with no
  8. Back-Cover Texts. A copy of the license is included in the
  9. section entitled "GNU Free Documentation License".
  10. -->
  11. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  12. <head>
  13. <title>GNU Binary Utilities: objdump</title>
  14. <meta name="description" content="GNU Binary Utilities: objdump">
  15. <meta name="keywords" content="GNU Binary Utilities: objdump">
  16. <meta name="resource-type" content="document">
  17. <meta name="distribution" content="global">
  18. <meta name="Generator" content="makeinfo">
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <link href="index.html#Top" rel="start" title="Top">
  21. <link href="Binutils-Index.html#Binutils-Index" rel="index" title="Binutils Index">
  22. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  23. <link href="index.html#Top" rel="up" title="Top">
  24. <link href="ranlib.html#ranlib" rel="next" title="ranlib">
  25. <link href="objcopy.html#objcopy" rel="prev" title="objcopy">
  26. <style type="text/css">
  27. <!--
  28. a.summary-letter {text-decoration: none}
  29. blockquote.smallquotation {font-size: smaller}
  30. div.display {margin-left: 3.2em}
  31. div.example {margin-left: 3.2em}
  32. div.indentedblock {margin-left: 3.2em}
  33. div.lisp {margin-left: 3.2em}
  34. div.smalldisplay {margin-left: 3.2em}
  35. div.smallexample {margin-left: 3.2em}
  36. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  37. div.smalllisp {margin-left: 3.2em}
  38. kbd {font-style:oblique}
  39. pre.display {font-family: inherit}
  40. pre.format {font-family: inherit}
  41. pre.menu-comment {font-family: serif}
  42. pre.menu-preformatted {font-family: serif}
  43. pre.smalldisplay {font-family: inherit; font-size: smaller}
  44. pre.smallexample {font-size: smaller}
  45. pre.smallformat {font-family: inherit; font-size: smaller}
  46. pre.smalllisp {font-size: smaller}
  47. span.nocodebreak {white-space:nowrap}
  48. span.nolinebreak {white-space:nowrap}
  49. span.roman {font-family:serif; font-weight:normal}
  50. span.sansserif {font-family:sans-serif; font-weight:normal}
  51. ul.no-bullet {list-style: none}
  52. -->
  53. </style>
  54. </head>
  55. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  56. <a name="objdump"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="ranlib.html#ranlib" accesskey="n" rel="next">ranlib</a>, Previous: <a href="objcopy.html#objcopy" accesskey="p" rel="prev">objcopy</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Binutils-Index.html#Binutils-Index" title="Index" rel="index">Index</a>]</p>
  60. </div>
  61. <hr>
  62. <a name="objdump-1"></a>
  63. <h2 class="chapter">4 objdump</h2>
  64. <a name="index-object-file-information"></a>
  65. <a name="index-objdump"></a>
  66. <div class="smallexample">
  67. <pre class="smallexample">objdump [<samp>-a</samp>|<samp>--archive-headers</samp>]
  68. [<samp>-b</samp> <var>bfdname</var>|<samp>--target=<var>bfdname</var></samp>]
  69. [<samp>-C</samp>|<samp>--demangle</samp>[=<var>style</var>] ]
  70. [<samp>-d</samp>|<samp>--disassemble</samp>]
  71. [<samp>-D</samp>|<samp>--disassemble-all</samp>]
  72. [<samp>-z</samp>|<samp>--disassemble-zeroes</samp>]
  73. [<samp>-EB</samp>|<samp>-EL</samp>|<samp>--endian=</samp>{big | little }]
  74. [<samp>-f</samp>|<samp>--file-headers</samp>]
  75. [<samp>-F</samp>|<samp>--file-offsets</samp>]
  76. [<samp>--file-start-context</samp>]
  77. [<samp>-g</samp>|<samp>--debugging</samp>]
  78. [<samp>-e</samp>|<samp>--debugging-tags</samp>]
  79. [<samp>-h</samp>|<samp>--section-headers</samp>|<samp>--headers</samp>]
  80. [<samp>-i</samp>|<samp>--info</samp>]
  81. [<samp>-j</samp> <var>section</var>|<samp>--section=</samp><var>section</var>]
  82. [<samp>-l</samp>|<samp>--line-numbers</samp>]
  83. [<samp>-S</samp>|<samp>--source</samp>]
  84. [<samp>-m</samp> <var>machine</var>|<samp>--architecture=</samp><var>machine</var>]
  85. [<samp>-M</samp> <var>options</var>|<samp>--disassembler-options=</samp><var>options</var>]
  86. [<samp>-p</samp>|<samp>--private-headers</samp>]
  87. [<samp>-P</samp> <var>options</var>|<samp>--private=</samp><var>options</var>]
  88. [<samp>-r</samp>|<samp>--reloc</samp>]
  89. [<samp>-R</samp>|<samp>--dynamic-reloc</samp>]
  90. [<samp>-s</samp>|<samp>--full-contents</samp>]
  91. [<samp>-W[lLiaprmfFsoRt]</samp>|
  92. <samp>--dwarf</samp>[=rawline,=decodedline,=info,=abbrev,=pubnames]
  93. [=aranges,=macro,=frames,=frames-interp,=str,=loc]
  94. [=Ranges,=pubtypes,=trace_info,=trace_abbrev]
  95. [=trace_aranges,=gdb_index]
  96. [<samp>-G</samp>|<samp>--stabs</samp>]
  97. [<samp>-t</samp>|<samp>--syms</samp>]
  98. [<samp>-T</samp>|<samp>--dynamic-syms</samp>]
  99. [<samp>-x</samp>|<samp>--all-headers</samp>]
  100. [<samp>-w</samp>|<samp>--wide</samp>]
  101. [<samp>--start-address=</samp><var>address</var>]
  102. [<samp>--stop-address=</samp><var>address</var>]
  103. [<samp>--prefix-addresses</samp>]
  104. [<samp>--[no-]show-raw-insn</samp>]
  105. [<samp>--adjust-vma=</samp><var>offset</var>]
  106. [<samp>--dwarf-depth=<var>n</var></samp>]
  107. [<samp>--dwarf-start=<var>n</var></samp>]
  108. [<samp>--special-syms</samp>]
  109. [<samp>--prefix=</samp><var>prefix</var>]
  110. [<samp>--prefix-strip=</samp><var>level</var>]
  111. [<samp>--insn-width=</samp><var>width</var>]
  112. [<samp>-V</samp>|<samp>--version</samp>]
  113. [<samp>-H</samp>|<samp>--help</samp>]
  114. <var>objfile</var>&hellip;
  115. </pre></div>
  116. <p><code>objdump</code> displays information about one or more object files.
  117. The options control what particular information to display. This
  118. information is mostly useful to programmers who are working on the
  119. compilation tools, as opposed to programmers who just want their
  120. program to compile and work.
  121. </p>
  122. <p><var>objfile</var>&hellip; are the object files to be examined. When you
  123. specify archives, <code>objdump</code> shows information on each of the member
  124. object files.
  125. </p>
  126. <p>The long and short forms of options, shown here as alternatives, are
  127. equivalent. At least one option from the list
  128. <samp>-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-P,-r,-R,-s,-S,-t,-T,-V,-x</samp> must be given.
  129. </p>
  130. <dl compact="compact">
  131. <dt><code>-a</code></dt>
  132. <dt><code>--archive-header</code></dt>
  133. <dd><a name="index-archive-headers"></a>
  134. <p>If any of the <var>objfile</var> files are archives, display the archive
  135. header information (in a format similar to &lsquo;<samp>ls -l</samp>&rsquo;). Besides the
  136. information you could list with &lsquo;<samp>ar tv</samp>&rsquo;, &lsquo;<samp>objdump -a</samp>&rsquo; shows
  137. the object file format of each archive member.
  138. </p>
  139. </dd>
  140. <dt><code>--adjust-vma=<var>offset</var></code></dt>
  141. <dd><a name="index-section-addresses-in-objdump"></a>
  142. <a name="index-VMA-in-objdump"></a>
  143. <p>When dumping information, first add <var>offset</var> to all the section
  144. addresses. This is useful if the section addresses do not correspond to
  145. the symbol table, which can happen when putting sections at particular
  146. addresses when using a format which can not represent section addresses,
  147. such as a.out.
  148. </p>
  149. </dd>
  150. <dt><code>-b <var>bfdname</var></code></dt>
  151. <dt><code>--target=<var>bfdname</var></code></dt>
  152. <dd><a name="index-object-code-format-1"></a>
  153. <p>Specify that the object-code format for the object files is
  154. <var>bfdname</var>. This option may not be necessary; <var>objdump</var> can
  155. automatically recognize many formats.
  156. </p>
  157. <p>For example,
  158. </p><div class="example">
  159. <pre class="example">objdump -b oasys -m vax -h fu.o
  160. </pre></div>
  161. <p>displays summary information from the section headers (<samp>-h</samp>) of
  162. <samp>fu.o</samp>, which is explicitly identified (<samp>-m</samp>) as a VAX object
  163. file in the format produced by Oasys compilers. You can list the
  164. formats available with the <samp>-i</samp> option.
  165. See <a href="Target-Selection.html#Target-Selection">Target Selection</a>, for more information.
  166. </p>
  167. </dd>
  168. <dt><code>-C</code></dt>
  169. <dt><code>--demangle[=<var>style</var>]</code></dt>
  170. <dd><a name="index-demangling-in-objdump"></a>
  171. <p>Decode (<em>demangle</em>) low-level symbol names into user-level names.
  172. Besides removing any initial underscore prepended by the system, this
  173. makes C++ function names readable. Different compilers have different
  174. mangling styles. The optional demangling style argument can be used to
  175. choose an appropriate demangling style for your compiler. See <a href="c_002b_002bfilt.html#c_002b_002bfilt">c++filt</a>,
  176. for more information on demangling.
  177. </p>
  178. </dd>
  179. <dt><code>-g</code></dt>
  180. <dt><code>--debugging</code></dt>
  181. <dd><p>Display debugging information. This attempts to parse STABS and IEEE
  182. debugging format information stored in the file and print it out using
  183. a C like syntax. If neither of these formats are found this option
  184. falls back on the <samp>-W</samp> option to print any DWARF information in
  185. the file.
  186. </p>
  187. </dd>
  188. <dt><code>-e</code></dt>
  189. <dt><code>--debugging-tags</code></dt>
  190. <dd><p>Like <samp>-g</samp>, but the information is generated in a format compatible
  191. with ctags tool.
  192. </p>
  193. </dd>
  194. <dt><code>-d</code></dt>
  195. <dt><code>--disassemble</code></dt>
  196. <dd><a name="index-disassembling-object-code"></a>
  197. <a name="index-machine-instructions"></a>
  198. <p>Display the assembler mnemonics for the machine instructions from
  199. <var>objfile</var>. This option only disassembles those sections which are
  200. expected to contain instructions.
  201. </p>
  202. </dd>
  203. <dt><code>-D</code></dt>
  204. <dt><code>--disassemble-all</code></dt>
  205. <dd><p>Like <samp>-d</samp>, but disassemble the contents of all sections, not just
  206. those expected to contain instructions.
  207. </p>
  208. <p>This option also has a subtle effect on the disassembly of
  209. instructions in code sections. When option <samp>-d</samp> is in effect
  210. objdump will assume that any symbols present in a code section occur
  211. on the boundary between instructions and it will refuse to disassemble
  212. across such a boundary. When option <samp>-D</samp> is in effect however
  213. this assumption is supressed. This means that it is possible for the
  214. output of <samp>-d</samp> and <samp>-D</samp> to differ if, for example, data
  215. is stored in code sections.
  216. </p>
  217. <p>If the target is an ARM architecture this switch also has the effect
  218. of forcing the disassembler to decode pieces of data found in code
  219. sections as if they were instructions.
  220. </p>
  221. </dd>
  222. <dt><code>--prefix-addresses</code></dt>
  223. <dd><p>When disassembling, print the complete address on each line. This is
  224. the older disassembly format.
  225. </p>
  226. </dd>
  227. <dt><code>-EB</code></dt>
  228. <dt><code>-EL</code></dt>
  229. <dt><code>--endian={big|little}</code></dt>
  230. <dd><a name="index-endianness"></a>
  231. <a name="index-disassembly-endianness"></a>
  232. <p>Specify the endianness of the object files. This only affects
  233. disassembly. This can be useful when disassembling a file format which
  234. does not describe endianness information, such as S-records.
  235. </p>
  236. </dd>
  237. <dt><code>-f</code></dt>
  238. <dt><code>--file-headers</code></dt>
  239. <dd><a name="index-object-file-header"></a>
  240. <p>Display summary information from the overall header of
  241. each of the <var>objfile</var> files.
  242. </p>
  243. </dd>
  244. <dt><code>-F</code></dt>
  245. <dt><code>--file-offsets</code></dt>
  246. <dd><a name="index-object-file-offsets"></a>
  247. <p>When disassembling sections, whenever a symbol is displayed, also
  248. display the file offset of the region of data that is about to be
  249. dumped. If zeroes are being skipped, then when disassembly resumes,
  250. tell the user how many zeroes were skipped and the file offset of the
  251. location from where the disassembly resumes. When dumping sections,
  252. display the file offset of the location from where the dump starts.
  253. </p>
  254. </dd>
  255. <dt><code>--file-start-context</code></dt>
  256. <dd><a name="index-source-code-context"></a>
  257. <p>Specify that when displaying interlisted source code/disassembly
  258. (assumes <samp>-S</samp>) from a file that has not yet been displayed, extend the
  259. context to the start of the file.
  260. </p>
  261. </dd>
  262. <dt><code>-h</code></dt>
  263. <dt><code>--section-headers</code></dt>
  264. <dt><code>--headers</code></dt>
  265. <dd><a name="index-section-headers"></a>
  266. <p>Display summary information from the section headers of the
  267. object file.
  268. </p>
  269. <p>File segments may be relocated to nonstandard addresses, for example by
  270. using the <samp>-Ttext</samp>, <samp>-Tdata</samp>, or <samp>-Tbss</samp> options to
  271. <code>ld</code>. However, some object file formats, such as a.out, do not
  272. store the starting address of the file segments. In those situations,
  273. although <code>ld</code> relocates the sections correctly, using &lsquo;<samp>objdump
  274. -h</samp>&rsquo; to list the file section headers cannot show the correct addresses.
  275. Instead, it shows the usual addresses, which are implicit for the
  276. target.
  277. </p>
  278. <p>Note, in some cases it is possible for a section to have both the
  279. READONLY and the NOREAD attributes set. In such cases the NOREAD
  280. attribute takes precedence, but <code>objdump</code> will report both
  281. since the exact setting of the flag bits might be important.
  282. </p>
  283. </dd>
  284. <dt><code>-H</code></dt>
  285. <dt><code>--help</code></dt>
  286. <dd><p>Print a summary of the options to <code>objdump</code> and exit.
  287. </p>
  288. </dd>
  289. <dt><code>-i</code></dt>
  290. <dt><code>--info</code></dt>
  291. <dd><a name="index-architectures-available"></a>
  292. <a name="index-object-formats-available"></a>
  293. <p>Display a list showing all architectures and object formats available
  294. for specification with <samp>-b</samp> or <samp>-m</samp>.
  295. </p>
  296. </dd>
  297. <dt><code>-j <var>name</var></code></dt>
  298. <dt><code>--section=<var>name</var></code></dt>
  299. <dd><a name="index-section-information"></a>
  300. <p>Display information only for section <var>name</var>.
  301. </p>
  302. </dd>
  303. <dt><code>-l</code></dt>
  304. <dt><code>--line-numbers</code></dt>
  305. <dd><a name="index-source-filenames-for-object-files"></a>
  306. <p>Label the display (using debugging information) with the filename and
  307. source line numbers corresponding to the object code or relocs shown.
  308. Only useful with <samp>-d</samp>, <samp>-D</samp>, or <samp>-r</samp>.
  309. </p>
  310. </dd>
  311. <dt><code>-m <var>machine</var></code></dt>
  312. <dt><code>--architecture=<var>machine</var></code></dt>
  313. <dd><a name="index-architecture"></a>
  314. <a name="index-disassembly-architecture"></a>
  315. <p>Specify the architecture to use when disassembling object files. This
  316. can be useful when disassembling object files which do not describe
  317. architecture information, such as S-records. You can list the available
  318. architectures with the <samp>-i</samp> option.
  319. </p>
  320. <p>If the target is an ARM architecture then this switch has an
  321. additional effect. It restricts the disassembly to only those
  322. instructions supported by the architecture specified by <var>machine</var>.
  323. If it is necessary to use this switch because the input file does not
  324. contain any architecture information, but it is also desired to
  325. disassemble all the instructions use <samp>-marm</samp>.
  326. </p>
  327. </dd>
  328. <dt><code>-M <var>options</var></code></dt>
  329. <dt><code>--disassembler-options=<var>options</var></code></dt>
  330. <dd><p>Pass target specific information to the disassembler. Only supported on
  331. some targets. If it is necessary to specify more than one
  332. disassembler option then multiple <samp>-M</samp> options can be used or
  333. can be placed together into a comma separated list.
  334. </p>
  335. <p>For ARC, <samp>dsp</samp> controls the printing of DSP instructions,
  336. <samp>spfp</samp> selects the printing of FPX single precision FP
  337. instructions, <samp>dpfp</samp> selects the printing of FPX double
  338. precision FP instructions, <samp>quarkse_em</samp> selects the printing of
  339. special QuarkSE-EM instructions, <samp>fpuda</samp> selects the printing
  340. of double precision assist instructions, <samp>fpus</samp> selects the
  341. printing of FPU single precision FP instructions, while <samp>fpud</samp>
  342. selects the printing of FPU souble precision FP instructions.
  343. </p>
  344. <p>If the target is an ARM architecture then this switch can be used to
  345. select which register name set is used during disassembler. Specifying
  346. <samp>-M reg-names-std</samp> (the default) will select the register names as
  347. used in ARM&rsquo;s instruction set documentation, but with register 13 called
  348. &rsquo;sp&rsquo;, register 14 called &rsquo;lr&rsquo; and register 15 called &rsquo;pc&rsquo;. Specifying
  349. <samp>-M reg-names-apcs</samp> will select the name set used by the ARM
  350. Procedure Call Standard, whilst specifying <samp>-M reg-names-raw</samp> will
  351. just use &lsquo;<samp>r</samp>&rsquo; followed by the register number.
  352. </p>
  353. <p>There are also two variants on the APCS register naming scheme enabled
  354. by <samp>-M reg-names-atpcs</samp> and <samp>-M reg-names-special-atpcs</samp> which
  355. use the ARM/Thumb Procedure Call Standard naming conventions. (Either
  356. with the normal register names or the special register names).
  357. </p>
  358. <p>This option can also be used for ARM architectures to force the
  359. disassembler to interpret all instructions as Thumb instructions by
  360. using the switch <samp>--disassembler-options=force-thumb</samp>. This can be
  361. useful when attempting to disassemble thumb code produced by other
  362. compilers.
  363. </p>
  364. <p>For the x86, some of the options duplicate functions of the <samp>-m</samp>
  365. switch, but allow finer grained control. Multiple selections from the
  366. following may be specified as a comma separated string.
  367. </p><dl compact="compact">
  368. <dt><code>x86-64</code></dt>
  369. <dt><code>i386</code></dt>
  370. <dt><code>i8086</code></dt>
  371. <dd><p>Select disassembly for the given architecture.
  372. </p>
  373. </dd>
  374. <dt><code>intel</code></dt>
  375. <dt><code>att</code></dt>
  376. <dd><p>Select between intel syntax mode and AT&amp;T syntax mode.
  377. </p>
  378. </dd>
  379. <dt><code>amd64</code></dt>
  380. <dt><code>intel64</code></dt>
  381. <dd><p>Select between AMD64 ISA and Intel64 ISA.
  382. </p>
  383. </dd>
  384. <dt><code>intel-mnemonic</code></dt>
  385. <dt><code>att-mnemonic</code></dt>
  386. <dd><p>Select between intel mnemonic mode and AT&amp;T mnemonic mode.
  387. Note: <code>intel-mnemonic</code> implies <code>intel</code> and
  388. <code>att-mnemonic</code> implies <code>att</code>.
  389. </p>
  390. </dd>
  391. <dt><code>addr64</code></dt>
  392. <dt><code>addr32</code></dt>
  393. <dt><code>addr16</code></dt>
  394. <dt><code>data32</code></dt>
  395. <dt><code>data16</code></dt>
  396. <dd><p>Specify the default address size and operand size. These four options
  397. will be overridden if <code>x86-64</code>, <code>i386</code> or <code>i8086</code>
  398. appear later in the option string.
  399. </p>
  400. </dd>
  401. <dt><code>suffix</code></dt>
  402. <dd><p>When in AT&amp;T mode, instructs the disassembler to print a mnemonic
  403. suffix even when the suffix could be inferred by the operands.
  404. </p></dd>
  405. </dl>
  406. <p>For PowerPC, <samp>booke</samp> controls the disassembly of BookE
  407. instructions. <samp>32</samp> and <samp>64</samp> select PowerPC and
  408. PowerPC64 disassembly, respectively. <samp>e300</samp> selects
  409. disassembly for the e300 family. <samp>440</samp> selects disassembly for
  410. the PowerPC 440. <samp>ppcps</samp> selects disassembly for the paired
  411. single instructions of the PPC750CL.
  412. </p>
  413. <p>For MIPS, this option controls the printing of instruction mnemonic
  414. names and register names in disassembled instructions. Multiple
  415. selections from the following may be specified as a comma separated
  416. string, and invalid options are ignored:
  417. </p>
  418. <dl compact="compact">
  419. <dt><code>no-aliases</code></dt>
  420. <dd><p>Print the &rsquo;raw&rsquo; instruction mnemonic instead of some pseudo
  421. instruction mnemonic. I.e., print &rsquo;daddu&rsquo; or &rsquo;or&rsquo; instead of &rsquo;move&rsquo;,
  422. &rsquo;sll&rsquo; instead of &rsquo;nop&rsquo;, etc.
  423. </p>
  424. </dd>
  425. <dt><code>msa</code></dt>
  426. <dd><p>Disassemble MSA instructions.
  427. </p>
  428. </dd>
  429. <dt><code>virt</code></dt>
  430. <dd><p>Disassemble the virtualization ASE instructions.
  431. </p>
  432. </dd>
  433. <dt><code>xpa</code></dt>
  434. <dd><p>Disassemble the eXtended Physical Address (XPA) ASE instructions.
  435. </p>
  436. </dd>
  437. <dt><code>gpr-names=<var>ABI</var></code></dt>
  438. <dd><p>Print GPR (general-purpose register) names as appropriate
  439. for the specified ABI. By default, GPR names are selected according to
  440. the ABI of the binary being disassembled.
  441. </p>
  442. </dd>
  443. <dt><code>fpr-names=<var>ABI</var></code></dt>
  444. <dd><p>Print FPR (floating-point register) names as
  445. appropriate for the specified ABI. By default, FPR numbers are printed
  446. rather than names.
  447. </p>
  448. </dd>
  449. <dt><code>cp0-names=<var>ARCH</var></code></dt>
  450. <dd><p>Print CP0 (system control coprocessor; coprocessor 0) register names
  451. as appropriate for the CPU or architecture specified by
  452. <var>ARCH</var>. By default, CP0 register names are selected according to
  453. the architecture and CPU of the binary being disassembled.
  454. </p>
  455. </dd>
  456. <dt><code>hwr-names=<var>ARCH</var></code></dt>
  457. <dd><p>Print HWR (hardware register, used by the <code>rdhwr</code> instruction) names
  458. as appropriate for the CPU or architecture specified by
  459. <var>ARCH</var>. By default, HWR names are selected according to
  460. the architecture and CPU of the binary being disassembled.
  461. </p>
  462. </dd>
  463. <dt><code>reg-names=<var>ABI</var></code></dt>
  464. <dd><p>Print GPR and FPR names as appropriate for the selected ABI.
  465. </p>
  466. </dd>
  467. <dt><code>reg-names=<var>ARCH</var></code></dt>
  468. <dd><p>Print CPU-specific register names (CP0 register and HWR names)
  469. as appropriate for the selected CPU or architecture.
  470. </p></dd>
  471. </dl>
  472. <p>For any of the options listed above, <var>ABI</var> or
  473. <var>ARCH</var> may be specified as &lsquo;<samp>numeric</samp>&rsquo; to have numbers printed
  474. rather than names, for the selected types of registers.
  475. You can list the available values of <var>ABI</var> and <var>ARCH</var> using
  476. the <samp>--help</samp> option.
  477. </p>
  478. <p>For VAX, you can specify function entry addresses with <samp>-M
  479. entry:0xf00ba</samp>. You can use this multiple times to properly
  480. disassemble VAX binary files that don&rsquo;t contain symbol tables (like
  481. ROM dumps). In these cases, the function entry mask would otherwise
  482. be decoded as VAX instructions, which would probably lead the rest
  483. of the function being wrongly disassembled.
  484. </p>
  485. </dd>
  486. <dt><code>-p</code></dt>
  487. <dt><code>--private-headers</code></dt>
  488. <dd><p>Print information that is specific to the object file format. The exact
  489. information printed depends upon the object file format. For some
  490. object file formats, no additional information is printed.
  491. </p>
  492. </dd>
  493. <dt><code>-P <var>options</var></code></dt>
  494. <dt><code>--private=<var>options</var></code></dt>
  495. <dd><p>Print information that is specific to the object file format. The
  496. argument <var>options</var> is a comma separated list that depends on the
  497. format (the lists of options is displayed with the help).
  498. </p>
  499. <p>For XCOFF, the available options are:
  500. </p><dl compact="compact">
  501. <dt><code>header</code></dt>
  502. <dt><code>aout</code></dt>
  503. <dt><code>sections</code></dt>
  504. <dt><code>syms</code></dt>
  505. <dt><code>relocs</code></dt>
  506. <dt><code>lineno,</code></dt>
  507. <dt><code>loader</code></dt>
  508. <dt><code>except</code></dt>
  509. <dt><code>typchk</code></dt>
  510. <dt><code>traceback</code></dt>
  511. <dt><code>toc</code></dt>
  512. <dt><code>ldinfo</code></dt>
  513. </dl>
  514. <p>Not all object formats support this option. In particular the ELF
  515. format does not use it.
  516. </p>
  517. </dd>
  518. <dt><code>-r</code></dt>
  519. <dt><code>--reloc</code></dt>
  520. <dd><a name="index-relocation-entries_002c-in-object-file"></a>
  521. <p>Print the relocation entries of the file. If used with <samp>-d</samp> or
  522. <samp>-D</samp>, the relocations are printed interspersed with the
  523. disassembly.
  524. </p>
  525. </dd>
  526. <dt><code>-R</code></dt>
  527. <dt><code>--dynamic-reloc</code></dt>
  528. <dd><a name="index-dynamic-relocation-entries_002c-in-object-file"></a>
  529. <p>Print the dynamic relocation entries of the file. This is only
  530. meaningful for dynamic objects, such as certain types of shared
  531. libraries. As for <samp>-r</samp>, if used with <samp>-d</samp> or
  532. <samp>-D</samp>, the relocations are printed interspersed with the
  533. disassembly.
  534. </p>
  535. </dd>
  536. <dt><code>-s</code></dt>
  537. <dt><code>--full-contents</code></dt>
  538. <dd><a name="index-sections_002c-full-contents"></a>
  539. <a name="index-object-file-sections"></a>
  540. <p>Display the full contents of any sections requested. By default all
  541. non-empty sections are displayed.
  542. </p>
  543. </dd>
  544. <dt><code>-S</code></dt>
  545. <dt><code>--source</code></dt>
  546. <dd><a name="index-source-disassembly"></a>
  547. <a name="index-disassembly_002c-with-source"></a>
  548. <p>Display source code intermixed with disassembly, if possible. Implies
  549. <samp>-d</samp>.
  550. </p>
  551. </dd>
  552. <dt><code>--prefix=<var>prefix</var></code></dt>
  553. <dd><a name="index-Add-prefix-to-absolute-paths"></a>
  554. <p>Specify <var>prefix</var> to add to the absolute paths when used with
  555. <samp>-S</samp>.
  556. </p>
  557. </dd>
  558. <dt><code>--prefix-strip=<var>level</var></code></dt>
  559. <dd><a name="index-Strip-absolute-paths"></a>
  560. <p>Indicate how many initial directory names to strip off the hardwired
  561. absolute paths. It has no effect without <samp>--prefix=</samp><var>prefix</var>.
  562. </p>
  563. </dd>
  564. <dt><code>--show-raw-insn</code></dt>
  565. <dd><p>When disassembling instructions, print the instruction in hex as well as
  566. in symbolic form. This is the default except when
  567. <samp>--prefix-addresses</samp> is used.
  568. </p>
  569. </dd>
  570. <dt><code>--no-show-raw-insn</code></dt>
  571. <dd><p>When disassembling instructions, do not print the instruction bytes.
  572. This is the default when <samp>--prefix-addresses</samp> is used.
  573. </p>
  574. </dd>
  575. <dt><code>--insn-width=<var>width</var></code></dt>
  576. <dd><a name="index-Instruction-width"></a>
  577. <p>Display <var>width</var> bytes on a single line when disassembling
  578. instructions.
  579. </p>
  580. </dd>
  581. <dt><code>-W[lLiaprmfFsoRt]</code></dt>
  582. <dt><code>--dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames]</code></dt>
  583. <dt><code>--dwarf[=aranges,=macro,=frames,=frames-interp,=str,=loc]</code></dt>
  584. <dt><code>--dwarf[=Ranges,=pubtypes,=trace_info,=trace_abbrev]</code></dt>
  585. <dt><code>--dwarf[=trace_aranges,=gdb_index]</code></dt>
  586. <dd><a name="index-DWARF"></a>
  587. <a name="index-debug-symbols"></a>
  588. <p>Displays the contents of the debug sections in the file, if any are
  589. present. If one of the optional letters or words follows the switch
  590. then only data found in those specific sections will be dumped.
  591. </p>
  592. <p>Note that there is no single letter option to display the content of
  593. trace sections or .gdb_index.
  594. </p>
  595. <p>Note: the output from the <samp>=info</samp> option can also be affected
  596. by the options <samp>--dwarf-depth</samp>, the <samp>--dwarf-start</samp> and
  597. the <samp>--dwarf-check</samp>.
  598. </p>
  599. </dd>
  600. <dt><code>--dwarf-depth=<var>n</var></code></dt>
  601. <dd><p>Limit the dump of the <code>.debug_info</code> section to <var>n</var> children.
  602. This is only useful with <samp>--dwarf=info</samp>. The default is
  603. to print all DIEs; the special value 0 for <var>n</var> will also have this
  604. effect.
  605. </p>
  606. <p>With a non-zero value for <var>n</var>, DIEs at or deeper than <var>n</var>
  607. levels will not be printed. The range for <var>n</var> is zero-based.
  608. </p>
  609. </dd>
  610. <dt><code>--dwarf-start=<var>n</var></code></dt>
  611. <dd><p>Print only DIEs beginning with the DIE numbered <var>n</var>. This is only
  612. useful with <samp>--dwarf=info</samp>.
  613. </p>
  614. <p>If specified, this option will suppress printing of any header
  615. information and all DIEs before the DIE numbered <var>n</var>. Only
  616. siblings and children of the specified DIE will be printed.
  617. </p>
  618. <p>This can be used in conjunction with <samp>--dwarf-depth</samp>.
  619. </p>
  620. </dd>
  621. <dt><code>--dwarf-check</code></dt>
  622. <dd><p>Enable additional checks for consistency of Dwarf information.
  623. </p>
  624. </dd>
  625. <dt><code>-G</code></dt>
  626. <dt><code>--stabs</code></dt>
  627. <dd><a name="index-stab"></a>
  628. <a name="index-_002estab"></a>
  629. <a name="index-debug-symbols-1"></a>
  630. <a name="index-ELF-object-file-format"></a>
  631. <p>Display the full contents of any sections requested. Display the
  632. contents of the .stab and .stab.index and .stab.excl sections from an
  633. ELF file. This is only useful on systems (such as Solaris 2.0) in which
  634. <code>.stab</code> debugging symbol-table entries are carried in an ELF
  635. section. In most other file formats, debugging symbol-table entries are
  636. interleaved with linkage symbols, and are visible in the <samp>--syms</samp>
  637. output.
  638. </p>
  639. </dd>
  640. <dt><code>--start-address=<var>address</var></code></dt>
  641. <dd><a name="index-start_002daddress"></a>
  642. <p>Start displaying data at the specified address. This affects the output
  643. of the <samp>-d</samp>, <samp>-r</samp> and <samp>-s</samp> options.
  644. </p>
  645. </dd>
  646. <dt><code>--stop-address=<var>address</var></code></dt>
  647. <dd><a name="index-stop_002daddress"></a>
  648. <p>Stop displaying data at the specified address. This affects the output
  649. of the <samp>-d</samp>, <samp>-r</samp> and <samp>-s</samp> options.
  650. </p>
  651. </dd>
  652. <dt><code>-t</code></dt>
  653. <dt><code>--syms</code></dt>
  654. <dd><a name="index-symbol-table-entries_002c-printing"></a>
  655. <p>Print the symbol table entries of the file.
  656. This is similar to the information provided by the &lsquo;<samp>nm</samp>&rsquo; program,
  657. although the display format is different. The format of the output
  658. depends upon the format of the file being dumped, but there are two main
  659. types. One looks like this:
  660. </p>
  661. <div class="smallexample">
  662. <pre class="smallexample">[ 4](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .bss
  663. [ 6](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 fred
  664. </pre></div>
  665. <p>where the number inside the square brackets is the number of the entry
  666. in the symbol table, the <var>sec</var> number is the section number, the
  667. <var>fl</var> value are the symbol&rsquo;s flag bits, the <var>ty</var> number is the
  668. symbol&rsquo;s type, the <var>scl</var> number is the symbol&rsquo;s storage class and
  669. the <var>nx</var> value is the number of auxilary entries associated with
  670. the symbol. The last two fields are the symbol&rsquo;s value and its name.
  671. </p>
  672. <p>The other common output format, usually seen with ELF based files,
  673. looks like this:
  674. </p>
  675. <div class="smallexample">
  676. <pre class="smallexample">00000000 l d .bss 00000000 .bss
  677. 00000000 g .text 00000000 fred
  678. </pre></div>
  679. <p>Here the first number is the symbol&rsquo;s value (sometimes refered to as
  680. its address). The next field is actually a set of characters and
  681. spaces indicating the flag bits that are set on the symbol. These
  682. characters are described below. Next is the section with which the
  683. symbol is associated or <em>*ABS*</em> if the section is absolute (ie
  684. not connected with any section), or <em>*UND*</em> if the section is
  685. referenced in the file being dumped, but not defined there.
  686. </p>
  687. <p>After the section name comes another field, a number, which for common
  688. symbols is the alignment and for other symbol is the size. Finally
  689. the symbol&rsquo;s name is displayed.
  690. </p>
  691. <p>The flag characters are divided into 7 groups as follows:
  692. </p><dl compact="compact">
  693. <dt><code>l</code></dt>
  694. <dt><code>g</code></dt>
  695. <dt><code>u</code></dt>
  696. <dt><code>!</code></dt>
  697. <dd><p>The symbol is a local (l), global (g), unique global (u), neither
  698. global nor local (a space) or both global and local (!). A
  699. symbol can be neither local or global for a variety of reasons, e.g.,
  700. because it is used for debugging, but it is probably an indication of
  701. a bug if it is ever both local and global. Unique global symbols are
  702. a GNU extension to the standard set of ELF symbol bindings. For such
  703. a symbol the dynamic linker will make sure that in the entire process
  704. there is just one symbol with this name and type in use.
  705. </p>
  706. </dd>
  707. <dt><code>w</code></dt>
  708. <dd><p>The symbol is weak (w) or strong (a space).
  709. </p>
  710. </dd>
  711. <dt><code>C</code></dt>
  712. <dd><p>The symbol denotes a constructor (C) or an ordinary symbol (a space).
  713. </p>
  714. </dd>
  715. <dt><code>W</code></dt>
  716. <dd><p>The symbol is a warning (W) or a normal symbol (a space). A warning
  717. symbol&rsquo;s name is a message to be displayed if the symbol following the
  718. warning symbol is ever referenced.
  719. </p>
  720. </dd>
  721. <dt><code>I</code></dt>
  722. <dt><code>i</code></dt>
  723. <dd><p>The symbol is an indirect reference to another symbol (I), a function
  724. to be evaluated during reloc processing (i) or a normal symbol (a
  725. space).
  726. </p>
  727. </dd>
  728. <dt><code>d</code></dt>
  729. <dt><code>D</code></dt>
  730. <dd><p>The symbol is a debugging symbol (d) or a dynamic symbol (D) or a
  731. normal symbol (a space).
  732. </p>
  733. </dd>
  734. <dt><code>F</code></dt>
  735. <dt><code>f</code></dt>
  736. <dt><code>O</code></dt>
  737. <dd><p>The symbol is the name of a function (F) or a file (f) or an object
  738. (O) or just a normal symbol (a space).
  739. </p></dd>
  740. </dl>
  741. </dd>
  742. <dt><code>-T</code></dt>
  743. <dt><code>--dynamic-syms</code></dt>
  744. <dd><a name="index-dynamic-symbol-table-entries_002c-printing"></a>
  745. <p>Print the dynamic symbol table entries of the file. This is only
  746. meaningful for dynamic objects, such as certain types of shared
  747. libraries. This is similar to the information provided by the &lsquo;<samp>nm</samp>&rsquo;
  748. program when given the <samp>-D</samp> (<samp>--dynamic</samp>) option.
  749. </p>
  750. <p>The output format is similar to that produced by the <samp>--syms</samp>
  751. option, except that an extra field is inserted before the symbol&rsquo;s
  752. name, giving the version information associated with the symbol.
  753. If the version is the default version to be used when resolving
  754. unversioned references to the symbol then it&rsquo;s displayed as is,
  755. otherwise it&rsquo;s put into parentheses.
  756. </p>
  757. </dd>
  758. <dt><code>--special-syms</code></dt>
  759. <dd><p>When displaying symbols include those which the target considers to be
  760. special in some way and which would not normally be of interest to the
  761. user.
  762. </p>
  763. </dd>
  764. <dt><code>-V</code></dt>
  765. <dt><code>--version</code></dt>
  766. <dd><p>Print the version number of <code>objdump</code> and exit.
  767. </p>
  768. </dd>
  769. <dt><code>-x</code></dt>
  770. <dt><code>--all-headers</code></dt>
  771. <dd><a name="index-all-header-information_002c-object-file"></a>
  772. <a name="index-header-information_002c-all"></a>
  773. <p>Display all available header information, including the symbol table and
  774. relocation entries. Using <samp>-x</samp> is equivalent to specifying all of
  775. <samp>-a -f -h -p -r -t</samp>.
  776. </p>
  777. </dd>
  778. <dt><code>-w</code></dt>
  779. <dt><code>--wide</code></dt>
  780. <dd><a name="index-wide-output_002c-printing"></a>
  781. <p>Format some lines for output devices that have more than 80 columns.
  782. Also do not truncate symbol names when they are displayed.
  783. </p>
  784. </dd>
  785. <dt><code>-z</code></dt>
  786. <dt><code>--disassemble-zeroes</code></dt>
  787. <dd><p>Normally the disassembly output will skip blocks of zeroes. This
  788. option directs the disassembler to disassemble those blocks, just like
  789. any other data.
  790. </p></dd>
  791. </dl>
  792. <hr>
  793. <div class="header">
  794. <p>
  795. Next: <a href="ranlib.html#ranlib" accesskey="n" rel="next">ranlib</a>, Previous: <a href="objcopy.html#objcopy" accesskey="p" rel="prev">objcopy</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Binutils-Index.html#Binutils-Index" title="Index" rel="index">Index</a>]</p>
  796. </div>
  797. </body>
  798. </html>