[PATCH] D34204: [LLD][LinkerScript] Allow non-alloc sections to be assigned to segments.

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 20 03:12:01 PDT 2017


andrewng added a comment.

In https://reviews.llvm.org/D34204#784448, @ruiu wrote:

> Hi Andrew,
>
> What are you actually trying to address with this patch? I'd like to know more about the background as to why you want this. Is there any reason you can't fix your program rather than the linker?


Hi Rui,

Basically, we have custom program headers in our binaries that are used by some of our tools. We need to be able to populate these segments with the sections containing the appropriate data. These sections are not allocated as they are not required to be loaded at runtime. The reason we need these program headers is that the section headers may be stripped from the binaries but our tools still need access to the data.

Note that GNU ld supports this behaviour too.

Cheers,
Andrew


https://reviews.llvm.org/D34204





More information about the llvm-commits mailing list