我可以使用GO Linker添加其他部分吗?
我使用GO
工具来编译和链接我的GO程序。我需要将其他部分添加到__文本
以这种方式产生的Mach-O二进制文件的段。可以这样做吗?为了进行比较,标准BSD ld
链接器具有一个名为-SectCreate
的标志(在其 man page ),允许用户指定一个文件,其内容应插入__ text,section-name-name-specify
。但是,我不确定如何询问go
工具来执行此操作,或者是否有可能。
(用例:具有根特权运行的Mac OS上的守护程序具有附加的代码签名和身份要求,特别是将具有诸如__ info_plist
之类的名称的新部分添加到__ text
segment有了某些不可启用的元数据内容,有一些背景讨论在这里。)
我想要 。要将我的GO程序作为MacOS上的特权守护程序运行,但是当我使用Go Build Build
编译时,看不到任何方法可以添加这些其他部分。
I use the go
tool to compile and link my go programs. I have a need to add additional sections to the __TEXT
segment of Mach-O binaries produced this way. Is it possible to do this? For comparison, the standard BSD ld
linker has a flag called -sectcreate
(described on its man page) that allows the user to specify a file whose contents should be inserted into the binary in __TEXT,section-name-you-specify
. However, I'm not sure how to ask the go
tool to do this, or whether it's even possible.
(Use case: daemons on Mac OS that run with root privileges have additional code-signing and identity requirements, specifically that new sections with names like __info_plist
be added to the __TEXT
segment with certain non-executable metadata content There's some background discussion of this here.)
I want to run my Go program as a privileged daemon on MacOS, but cannot see any way to add these additional sections when I compile with go build
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论