[PATCH] D42748: [ELF] Don't create a .dynamic section when linking with -Bstatic

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 07:19:21 PST 2018


arichardson added a comment.

In https://reviews.llvm.org/D42748#995558, @ed wrote:

> In https://reviews.llvm.org/D42748#994676, @arichardson wrote:
>
> > The dynamic symbol table is still included, it's only the PT_DYNAMIC, .dynamic and the _DYNAMIC symbol that are excluded.
>
>
> But within a running process, you need `PT_DYNAMIC` to be able to find the location of dynsym, right? I suspect that without it, dynsym will be nothing more than an unreferenced section.
>
> Omitting .dynamic and _DYNAMIC sounds perfectly fine to me!


I believe you need DT_DYNSYM to find it within a process so I guess I can't remove PT_DYNAMIC or .dynsym. I think the real problem is _DYNAMIC not resolving to null so that is fine by me.

It is slightly annoying that `file` will print that the executable is dynamically linked even though it isn't but I think that should probably fixed in the file source code rather than worked around here.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42748





More information about the llvm-commits mailing list