[llvm-commits] [lld] add support for followon references
Shankar Easwaran
shankare at codeaurora.org
Thu Nov 1 14:48:42 PDT 2012
Hi Nick,
Thanks for the review.
On 11/1/2012 3:40 PM, Nick Kledzik wrote:
> Shankar,
>
> Implementing follow-on references is really two steps: 1) core linking, 2) having ELF Reader create them if needed.
>
> For the core linking step, you need a bunch of yaml test cases which verify that the follow-on constraint is respected. For example:
> a) input has A, B, C, D with follow-on from B to C, a regular reference from D to B, and mark D don't dead strip, then enable dead strip and verify output is B, C, D.
Will add a testcase.
> b) input is A, B, C with following from C to B and B to A. Verify output is C, B, A (Note, you'll need to write a pass to do the re-order).
Isnt this a PrecededBy ?
> It should probably be illegal to have mergable atom involved in a follow-on reference.
Yes, I will add a check for this.
>
> Someone had an example of ELF that has a function doing a fixed jump backwards into an anonymous code before it. Just having follow-on references is not enough to support that in the face of dead code stripping. You also need preceded-by references (sort of doubly linked list).
Yes, will add a Preceded By reference too.
> Given that the idea here is to make negative Kind values be "core" References, supported on all platforms, lld::Reference should have a kindToString() and kindFromString() methods which do the conversion iff and only iff the kind is a core kind. Then platform specific kindToString() and kindFromString() don't have to add core <value,string> entries to their tables, they instead call through to do conversion of core kinds.
Nice. Which component would be using the kindToString() and
kindFromString() functions ? WriterYAML ?
> I don't think there is a need for a FollowOnReference class. The Readers that currently create References just need to be able to create a Reference with the kind set to kindFollowOnReference.
>
> Also, given that kindFollowOnReference is scoped inside of lld::Reference, the "Reference" part of the string is redundant. That is, clients will use lld::Reference::kindFollowOn.
>
> If you plan to add the back references too. We should come up with names that work together, such as:
> kindFollowedBy, kindPrecededBy
> kindLayoutBefore, kindLayoutAfter
>
Will add these too.
Thanks
Shankar Easwaran
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation
More information about the llvm-commits
mailing list