[PATCH] D17242: [ELF] - Linkerscript KEEP command.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 17:21:05 PST 2016


On Fri, Feb 19, 2016 at 7:35 AM, George Rimar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> >So, in the context of this change, I think the most important
> >performance cases are
> >
> >* Linker script is not used
> >* Linker script without KEEP
> >* Linker script with KEEP
> >
> I>f I read it correctly, the first case should not change much since
> >Sections will be empty.
> >
> >One interesting case you might want to add a test for and check what
> >bfd and gold do:
> >
> >A section name matches two entries in the SECTIONS directive. The
> >first one doesn't have KEEP, the second one does.
> >
> Like that ?
>
> SECTIONS {
>  .temp : { *(.keep) }
>  .keep : { KEEP(*(.keep)) }
> }
> vs
> SECTIONS {
>  .keep : { KEEP(*(.keep)) }
>  .temp : { *(.keep) }
> }
>
> For first case gold does not keep the section, for second - it does. So it
> depends on order.
> KEEP patch has the equal behavior. I updated the test cases to demonstrate.
>

Can you test with ld.bfd? Gold's behavior seems almost like it could be an
accident. If ld.bfd disagrees about this then we might need to pay extra
attention here (and perhaps want to follow ld.bfd's semantics since ld.bfd
is much more prevalent).

-- Sean Silva


>
> >I suggest that because I possible "optimization" that I though was to
> >check match only on section that have the Keep flag, but that would
> >change the result in this case.
> >
> >Cheers,
> >Rafael
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160219/876a7e23/attachment.html>


More information about the llvm-commits mailing list