Bug 842762

Summary: objdump should support Mach-O binaries
Product: [Fedora] Fedora Reporter: Karel Klíč <kklic>
Component: binutilsAssignee: Nick Clifton <nickc>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jakub, nickc, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-02 10:01:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Add mach-o support to x86 based binutils none

Description Karel Klíč 2012-07-24 14:25:10 UTC
Description of problem:
The objdump utility as compiled in Fedora cannot read Mac OS X binaries.

When working on a low-level stuff, one might need to investigate how things are done on other widely-used operating systems.  PE/COFF binaries can be investigated fine using objdump.   If Mach-O binaries are also viewable out of the box, developers would remain impressed by Fedora's versatility and first-class development support.

Version-Release number of selected component (if applicable):
binutils-2.22.52.0.3-1.fc18

Steps to Reproduce:
1. Download and unpack http://www.imagemagick.org/download/binaries/ImageMagick-x86_64-apple-darwin11.4.0.tar.gz.
2. cd ImageMagick-6*/bin
3. objdump -x convert

Actual results:
$ objdump -x convert 

objdump: convert: File format not recognized


Expected results:
$ objdump -x convert 

convert:     file format mach-o-x86-64
convert
architecture: i386:x86-64, flags 0x00000012:
EXEC_P, HAS_SYMS
start address 0x0000000100000e20
<snip>

Additional info:
One could solve this request effortlessly by adding `--enable-targets=all` to %configure, but somewhat more limited selection would be appropriate to keep the size of maintained code reasonable.

The list of targets that are being compiled into bfd are selected in bfd/config.bfd based on the `--target` value given to the configure script.

Please consider extending bfd/config.bfd to include mach-o on {i[3-7]86,x86_64}-*-linux, or some other adjustment that adds the mach-o support.

Comment 1 Nick Clifton 2012-08-02 10:00:15 UTC
Created attachment 601915 [details]
Add mach-o support to x86 based binutils

Hi Karel,

  I have considered this request, but I am sorry to have to say that I just do not think that it is appropriate.  Anyone working with low level details of binary files should be able to build their own toolchain targeted at whichever formats they like.  Adding support for Mach-O binaries to the general binutils package is just going to increase the maintainence burden and probably confuse people who don't understand about the difference between displaying binaries and linking binaries.

  For the record I did create a patch that adds Mach-O support to x86 based binutls rpms.  I have uploaded it to this bug report in case it useful to you.

Cheers
  Nick