[PATCH] D23031: [LinkerScript] Support OR of FLAGS in PHDR directives

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 14:58:30 PDT 2016


On Tue, Aug 2, 2016 at 2:50 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com
> wrote:

> On 2 August 2016 at 17:47, Rui Ueyama <ruiu at google.com> wrote:
> > If bfd linker actually accepts arbitrary expressions, I have no
> objection to
> > support that in LLD. My comment to Rafael's patch is to update the
> comment
> > -- passing 0 looks a bit odd but understandable, so I'd rather want you
> to
> > mention in the comment that bfd supports arbitrary expressions so do we.
>
> Will do, but note that it is a bit more than just odd. It means that
> things like
>
> PHDRS
> {
>   ph_foo PT_LOAD FLAGS(. | 2);
> }
>
> SECTIONS
> {
>   .text : {*(.dynamic) } : ph_foo
> }
>
>
> will "work". Amusingly ld.bfd does it too, so it would actually be bug
> for bug compatible.
>

I'm pretty sure that it's not an intended effect but just a result of
cutting corners because there is no sane way to use "." in that context.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160802/9b315529/attachment.html>


More information about the llvm-commits mailing list