[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

objcopy in binutils doesn't work on Mac OS X

From: Axel Simon
Subject: objcopy in binutils doesn't work on Mac OS X
Date: Mon, 26 Feb 2007 15:54:18 +0000


I'm trying to rename symbols in an archive using objcopy. It works
perfectly under Linux, but on Mac OS X, using binutils 2.16.1 (from
MacPorts) or 2.17 (from source), doesn't work. For example:

sinope:~ as49$ cat blah.c
int foo(int f) {
 int x;
 return x;

sinope:~ as49$ gcc -c blah.c -o blah.o
sinope:~ as49$ ar cru blah.a blah.o 
sinope:~ as49$ nm blah.a 

00000000 T _foo

sinope:~ as49$ gobjdump -a blah.o

blah.o:     file format mach-o-le

sinope:~ as49$ gobjdump -a blah.a
gobjdump: blah.a: File format not recognized

Here, gobjdump is version 2.16.1 from MacPorts, but 2.17 gives the same
error message. Note that ar and nm are from Apple and not GNU.
I tried to build objdump from source using

./configure --enable-64-bit-bfd --enable-targets=all

but I get an error message that the the object files are ambiguous with
respect to their format.

My machine is running Mac OS X 10.4.8 (8N1051)/Darwin 8.8.2, it is a
MacBookPro2,2 with an Intel Core 2 Duo which I assume uses a 32 bit ABI,
so I shouldn't even need the 64-bit versions. As far as I know, all
files I'm operating on are flat files.

Is this a bug or simply a lacking feature?

Any help appreciated,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]