I would like to rename symbols inside object files (.o) with something that would be the Mac equivalent of binutils' objcopy --redefine-syms
tool.
I found no arm-apple-darwin10-objcopy
. I tried the MacPorts' arm-elf-binutils
port and also tried to play a bit with otool
and segedit
without much success.
Any ideas please?
objconv does not currently work for ARM, so this option is not available for iPhone. It should be no problem to use objconv from elf to mach-o for mac osx x86/x64 though. Let me know if you found a solution for ARM
Sounds like a job for Agner Fog's objconv.
From the announcement:
objconv manual
objconv.zip - source
I know I'm resurrecting this post from the dead, but...
I have a sudden need to do this as well, and discovering that
objcopy
doesn't work on OSX was a bit of a shock. But I think it's possible to useld
to achieve the same effect:This really just creates an alias for the symbol under a new name and hides the old one.
I haven't had a chance to do much testing yet, but looking at the output file with
nm
shows it seems to be doing the right thing.