This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [libbdf] Mach-O format support ?
Tristan Gingold wrote:
>
> it is difficult to answer to such a vague question. The handling of Mach-O in bfd is good enough to
> have tools such as objdump working as well as gdb.
>
> If you can describe precisely your issue (a reproducer would be welcome), then I could start to
> investigate.
Yes, you're definitely right, my description was extremely loose.
I first thought that the binutils dev team had a "position" on not
supporting part of the Mach-O. So, I did dig a bit and I think I might
have found what is going on.
More precisely, on my Debian-based computer when attempting to
disassemble one of those problematic Mach-O, I get the following:
[================================================================]
[fleury@aldebaran bfd-macho]$ file ls.macos
ls.macos: Mach-O fat file with 2 architectures
[fleury@aldebaran bfd-macho]$ objdump -d ls.macos
objdump: ls.macos: File format not recognized
[================================================================]
And, indeed, objdump is not responsible of this problem because I
experiment the exact same problem with my own program when using the
bfd_perror() function.
Concerning my version of binutils:
[================================================================]
ii binutils 2.20.1-5
The GNU assembler, linker and binary utilities
ii binutils-dev 2.20.1-5
The GNU binary utilities (BFD development files)
ii binutils-doc 2.20.1-5
Documentation for the GNU assembler, linker and
binary utilities
ii binutils-multiarch 2.20.1-5
Binary utilities that support multi-arch targets
ii mingw32-binutils 2.20-0.1
Minimalist GNU win32 (cross) binutils
[================================================================]
On a Mac OS X computer, I have:
[================================================================]
punta:insight labri$ file /bin/ls
/bin/ls: Mach-O universal binary with 2 architectures
/bin/ls (for architecture i386): Mach-O executable i386
/bin/ls (for architecture ppc7400): Mach-O executable ppc
[================================================================]
And for software coming from MacPorts:
[================================================================]
punta:insight labri$ file /opt/local/bin/svn
/opt/local/bin/svn: Mach-O executable i386
[================================================================]
The binary from MacPorts can be accessed with no problem, on the
contrary of the one from /bin.
So, what I suspect is just that libbfd does not handle this 'multi-arch'
packaging feature that seems to be supported in Mach-O.
Is it right ?
And, then, a natural question would be: Is there anyone working on
support for this ?
Regards
--
Emmanuel Fleury
When it comes to software security, the devil is in the details.
-- Bruce Schneier