# Objdump

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Objdump
> Markdown URL: https://mediated.wiki/source/Objdump.md
> Source: https://en.wikipedia.org/wiki/Objdump
> Source revision: 1298282985
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Program for displaying information about object files}}
{{lowercase title|title=objdump}}
{{more citations needed |date=April 2025}}
{{Infobox software 
| name                   = objdump
| logo                   = 
| screenshot             = 
| screenshot size        = 
| caption                = 
| author                 = 
| developer              = 
| released               = 
| latest release version = 
| latest release date    = 
| operating system       = [Unix](/source/Unix) and [Unix-like](/source/Unix-like)
| genre                  = [Command](/source/Command_(computing))
| license                = [GNU GPL](/source/GNU_General_Public_License)
| website                = 
}}
'''objdump''' is a [command-line](/source/command-line_interface) program for displaying various information about [object file](/source/object_file)s on [Unix-like](/source/Unix-like) [operating system](/source/operating_system)s. For instance, it can be used as a [disassembler](/source/disassembler) to view an [executable](/source/executable) in assembly form. It is part of the [GNU Binutils](/source/GNU_Binutils) for fine-grained control over executables and other binary data. objdump uses the [BFD](/source/Binary_File_Descriptor_library) library to read the contents of object files. Similar utilities are [Borland TDUMP](/source/Turbo_Assembler), [Microsoft DUMPBIN](/source/Microsoft_Macro_Assembler) and [readelf](/source/readelf).

On certain platforms (e.g. [macOS](/source/macOS)), the objdump binary may actually be a link to [LLVM](/source/LLVM)'s objdump, with different command-line options and behavior.{{Citation needed|date=July 2023}} '''otool''' and [nm](/source/nm_(Unix)) perform analogous functions for [Mach-O](/source/Mach-O) files.<ref>{{cite web |url=https://developer.apple.com/forums/thread/715385 |title=An Apple Library Primer |publisher=[Apple Developer Forums](/source/Apple_Developer_Forums)}}</ref><ref>{{cite web |url=https://llvm.org/docs/CommandGuide/llvm-otool.html |title=llvm-otool - Mach-O dumping tool |publisher=[LLVM](/source/LLVM) Reference}}</ref>

==Example==
For example,

 $ objdump -D -M intel file.bin

This disassembles the file <code>file.bin</code>, showing its [assembly code](/source/assembly_language) in [Intel syntax](/source/Intel_syntax).

Example output:
<syntaxhighlight lang="objdump-nasm">
  4004ed	<main>:
  4004ed:	55                   	push   rbp
  4004ee:	48 89 e5             	mov    rbp,rsp
  4004f1:	c7 45 ec 00 00 00 00 	mov    DWORD PTR [rbp-0x14],0x0
  4004f8:	c7 45 f0 01 00 00 00 	mov    DWORD PTR [rbp-0x10],0x1
  4004ff:	c7 45 f4 02 00 00 00 	mov    DWORD PTR [rbp-0xc],0x2
  400506:	c7 45 f8 03 00 00 00 	mov    DWORD PTR [rbp-0x8],0x3
  40050d:	c7 45 fc 04 00 00 00 	mov    DWORD PTR [rbp-0x4],0x4
  400514:	c7 45 ec 00 00 00 00 	mov    DWORD PTR [rbp-0x14],0x0
  40051b:	eb 13                	jmp    400530 <main+0x43>
  40051d:	8b 05 15 0b 20 00    	mov    eax,DWORD PTR [rip+0x200b15]        # 601038 <globalA>
  400523:	83 e8 01             	sub    eax,0x1
  400526:	89 05 0c 0b 20 00    	mov    DWORD PTR [rip+0x200b0c],eax        # 601038 <globalA>
  40052c:	83 45 ec 01          	add    DWORD PTR [rbp-0x14],0x1
  400530:	8b 05 02 0b 20 00    	mov    eax,DWORD PTR [rip+0x200b02]        # 601038 <globalA>
  400536:	39 45 ec             	cmp    DWORD PTR [rbp-0x14],eax
  400539:	7c e2                	jl     40051d <main+0x30>
  40053b:	5d                   	pop    rbp
  40053c:	c3                   	ret
</syntaxhighlight>

==See also==
{{Portal|Computer programming}}
* [GNU Binutils](/source/GNU_Binutils)

==References==
{{Reflist}}

==External links==
* {{man|1|objdump|die.net}}
* {{man|1|readelf|die.net}}
* [https://metacpan.org/pod/Binutils::Objdump Binutils::Objdump] - [Perl](/source/Perl) interface to objdump

Category:Unix programming tools
Category:Disassemblers

{{unix-stub}}
{{foss-stub}}

---
Adapted from the Wikipedia article [Objdump](https://en.wikipedia.org/wiki/Objdump) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Objdump?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
