I found myself having to look at a Mach-O binary and found out the Fedora binutils package is built without support for it. Sure, I'm mainly going to find ELF binaries in a Linux systems, but it would be nice to have the capacity of looking into Mach-O (and others?) files, without having to build binutils, nevertheless.
Hi Cristian, Fedora has a separate cross-binutils package that provides builds for various different, not normally supported, architectures. (But not currently Mach-o). So I have reset the component to this package which should assign the BZ to David Howells. Who doubtless thank me profusely for giving this problem to him... Cheers Nick
I have to admit, I've never heard of it. I don't see a kernel arch for it upstream, which is the normal criterion. What's the --target tuple I should use to try this?
https://en.wikipedia.org/wiki/Mach-O AFAIK Mach-O is only used by Macs/iPhones. It's well possible the kernel doesn't know anything about it. But binutils has the support -> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=bfd/mach-o.c;h=d58e62d94e81d6d043d073d951581d8973299fb6;hb=HEAD In any case, without knowing the details, I'm not sure why "cross-" needs to be involved here. The bfd configure script takes "--enable-targets=all" and "--enable-plugins". So, couldn't the main binutils package be built with support for all the binary formats? Potentially even splitting it in subpackages, using "--enable-plugins", to avoid the extra space overhead for whoever is not interested in the support? Has been over two months since I looked at this, but AFAICR it did work.
--enable-targets=all still doesn't support all the targets, you don't get assemblers etc. that way for all the targets. And, enabling too many targets is a security risk for tools like strings etc., where specially crafted Mach-O and other objects could trigger bugs in that support.
Hi Cristian, > So, couldn't the main binutils package be built with > support for all the binary formats? I just want to second Jakub's point here. Enabling all targets in the default binutils is just asking for trouble. In particular almost all of the CVE bug reports against the binutils in the last few years have been against obscure and/or old formats like IEEE, and AOUT. So whilst I appreciate that it might be more convenient to enable support for all targets, I am not going to do it. Cheers Nick
Also, I've experimented with this in the past, and I seem to recall that enabling all targets makes the binutils binaries huge. I seem to remember an aggregate size on the order of a gigabyte, but I may be misremembering.
I can enable it, but you need to tell me what --target=xxx thing or things I need to add.