I'm trying to rename symbols in an archive using objcopy.
Your examples below use objdump rather than objcopy. Are you
experiencing the same problem with both tools ?
It works perfectly under Linux, but on Mac OS X,
Do you mean that you can run objcopy and/or objdump on the test binaries
if you are doing so under Linux, but not if you are doing so on a OS-X
host ? If so then this might indicate a build problem on the OS-X host.
ie the compiler used to build the binutils on the OS-X host might have
a bug in it.
using binutils 2.16.1 (from MacPorts) or 2.17 (from source), doesn't work.
Have you also tried the sources from the mainline of the binutils CVS
sinope:~ as49$ ar cru blah.a blah.o
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.
Is this a bug or simply a lacking feature?
This is a bug, although it is not clear where the bug lies. A couple of
quick tests might help narrow things down a bit:
* If you use the GNU version of ar to create the library, can gobjdump
then recognise the file format of the blah.a file ? If so, are you
able to identify the differences between blah.a created by the OS-X
tool and the blah.a created by the GNU tool ?
* Can you run "gobjdump -a blah.a" from inside GDB and put a
breakpoint on bfd_mach_o_archive_p() (in bfd/mach-o.c) ? Is this
function called at all ? If so, then at what point inside the
function does it decide that the blah.a file is not a MACH OS
library file ?
bug-binutils mailing list