Mac / iPhone 的 objcopy 等效项?
我想使用 Mac 上相当于 binutils 的 objcopy --redefine-syms
工具的东西来重命名对象文件 (.o) 内的符号。
我没有找到arm-apple-darwin10-objcopy
。我尝试了 MacPorts 的 arm-elf-binutils
端口,还尝试使用 otool
和 segedit
进行操作,但没有取得太大成功。
有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
听起来像是 Agner Fog 的 objconv 的工作。
来自 公告:
objconv 手册
objconv.zip - 源
Sounds like a job for Agner Fog's objconv.
From the announcement:
objconv manual
objconv.zip - source
我知道我正在复活这篇文章,但是......
我也突然需要这样做,并且发现 objcopy 在 OSX 上不起作用有点震惊。但我认为可以使用
ld
来达到相同的效果:这实际上只是在新名称下为符号创建一个别名并隐藏旧名称。
我还没有机会进行太多测试,但是使用 nm 查看输出文件表明它似乎正在做正确的事情。
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.objconv 目前不适用于 ARM,因此此选项不适用于 iPhone。不过,在 mac osx x86/x64 上使用 objconv 从 elf 到 mach-o 应该没有问题。如果您找到 ARM 的解决方案,请告诉我
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