This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [libbfd] Mach-O format support ?
On Apr 14, 2010, at 11:11 AM, mpsuzuki@hiroshima-u.ac.jp wrote:
> Hi,
>
> On Wed, 14 Apr 2010 10:49:02 +0200
> Tristan Gingold <gingold@adacore.com> wrote:
>>> on Mac OS X, "nm" complains as:
>>>
>>> $ ./nm-new /usr/lib/libwrap.a
>>> ./nm-new: /usr/lib/libwrap.a:i386: File format not recognized
>>> ./nm-new: /usr/lib/libwrap.a:powerpc:common: File format not recognized
>>
>> Yes, nm on universal archive doesn't work, because nm doesn't handle archives of archives!
>
> Thank you for quick reply!
>
> It seems that the "ar" of GNU binutils doesn't handle
> universal binary archive directly.
It can. It just see the universal binary as an archive. Eg:
$ ./binutils/ar tv /bin/ls
/bin/ls:i386:x86-64
/bin/ls:i386
> I guess the universal
> binary archive of Mac OS X is concatenated in fat binary
> format, instead of "ar" archive format.
Yes, it is a different format.
> In fact, even
> Apple's "ar" cannot parse the universal binary archive,
> it tells to split the universal binary archive by libtool/lipo
> and execute "ar" on the splitted files.
>
> Is there GNU replacement of Apple's lipo?
You can use binutils ar to list or extract a member of a universal binary, but you can't build a
universal binary with binutils tools. That's something I'd like to add, but it will require a change to
ar.
Tristan.