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

Andrew Ng via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 02:30:25 PDT 2017


Hi Rafael,

Thanks for following up.

The way that it works is that a program header has a "p_offset" and a
"p_filesz" which indicates the location and size of the section in the file
prior to loading. So this information allows the loader/tools to read/edit
certain metadata from the file before run-time. For example, a tool can
dump metadata in a specific segment even though section headers have been
stripped. The fact that "p_vaddr" and "p_memsz" are 0 in this case does not
matter as the section does not need to be loaded. That is why the section
is not allocated because it is not required at run-time.

I hope that clarifies the intended use case.

Cheers,
Andrew

On 29 June 2017 at 21:19, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> I still don't understand how can this be used.
>
> So please don't land it.
>
> Cheers,
> Rafael
>
> Andrew Ng via Phabricator <reviews at reviews.llvm.org> writes:
>
> > andrewng added a comment.
> >
> > In https://reviews.llvm.org/D34204#790836, @andrewng wrote:
> >
> >> Hi Rafael,
> >>
> >> Is this patch now good to land?
> >>
> >> Cheers,
> >> Andrew
> >
> >
> > Ping.
> >
> >
> > https://reviews.llvm.org/D34204
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170630/db884b74/attachment.html>


More information about the llvm-commits mailing list