[PATCH] D55211: [LLD][ELF] - Support discarding the .dynamic section.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 4 00:50:44 PST 2018


grimar added a comment.

In D55211#1316973 <https://reviews.llvm.org/D55211#1316973>, @peter.smith wrote:

>   One thought I had that could potentially simplify all three patches is to treat .dynamic, .dynstr and and .dynsym as a single discardable unit. For example: 
>
> - The .dynsym is not useful without the .dynstr.
> - If there is a .dynsym then there must be a symbol that needs looking up with a dynamic loader, hence there is a strong case for the .dynamic section.


I think when these sections (or other important ones) are discarded our aim perhaps is not to crash. 
My idea from having 3 patches was to allow LLD to produce the output without crashes and without additional thinking about the dependencies.
I.e. just allow the user to do what he or she requests in the script. User assumed to know about some sections relationship and meanings.
Given that removing these sections is a rare scenario, I think it is reasonable to do a minimal code change for simple relaxing the current LLD behavior.

In D55211#1317015 <https://reviews.llvm.org/D55211#1317015>, @peter.smith wrote:

> I've managed to build the linux kernel with D55211 <https://reviews.llvm.org/D55211>, D55215 <https://reviews.llvm.org/D55215> and D55218 <https://reviews.llvm.org/D55218> (after working around https://bugs.llvm.org/show_bug.cgi?id=39857) . I've not got the means to run the kernel, but it seems like the rela.dyn is present and correct  and can be dumped with readelf.


Great, thanks!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55211/new/

https://reviews.llvm.org/D55211





More information about the llvm-commits mailing list