gcc 忽略 -Wl,--dynamic-linker 开关

发布于 2024-10-08 06:18:11 字数 118 浏览 0 评论 0原文

我正在尝试使 --dynamic-linker 选项与 CodeSourcery 的 ARM 交叉工具链一起使用。然而 gcc 似乎忽略了它,并且从未在共享库的 ELF 中添加解释器段。为了使这项工作顺利进行,我缺少什么?

I'm trying to make the --dynamic-linker option work with CodeSourcery's ARM cross toolchain. However gcc seems to ignore it, and never adds an interpreter segment in the shared library's ELF. What am I missing to make this work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

始于初秋 2024-10-15 06:18:11

我怀疑 gcc 会忽略该选项。将 -v 添加到编译器命令行以验证该选项确实已传递给链接器。

更有可能的是,您错误地使用了该选项。 --dynamic-linker 正在接受一个 =file 参数,并且您没有提到您正在传递一个参数。

编辑:正如您所发现的,链接器脚本中没有 .interp 部分。但是,您应该 - 请参阅此示例

I doubt gcc ignores the option. Add -v to the compiler command line to verify that the option is indeed passed to the linker.

More likely, you are using the option incorrectly. --dynamic-linker is taking a =file argument, and you didn't mention that you are passing one.

Edit: as you found out, you have no .interp section in your linker script. However, you should - see this example.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文