[LLVMdev] [lld] Overloaded Layout references

Michael Spencer bigcheesegs at gmail.com
Wed Jan 28 04:28:18 PST 2015


On Tue, Jan 27, 2015 at 11:58 PM, Shankar Easwaran
<shankare at codeaurora.org> wrote:
> Hi,
>
> I think we are overloading the Layout references for garbage collection.

one of the original points of layout references was for correct GC.

>
> If you are creating a reference (kindLayoutAfter) from A to B, that may not
> mean that you cannot garbage collect B for the end user.

The way we implement ELF semantics say you can't. We can only GC
entire sections. You can't just yank an atom out of a layoutAfter
chain.

>
> My thought on Layout references was that it only guarantees that atoms
> appear in Layout reference order.

GC is really simple right now. You just follow all references. Doing
this would require checking each reference for if it's a "real"
reference. While not a complicated change, it removes the purity of
the graph model.

>
> Why are we overloading this for Garbage collection (aside from saving
> space/code) ?
>
> We should create kindLive (or) some better name IMO for Garbage collection.
> With this the complex LayoutPass can be optional and would be meant only for
> users that need the LayoutReferences to specify layout of the image.

The only current use of layout references is to preserve object file
semantics. If we want to implement that some other way, we should
remove LayoutReferences. We're already having performance issues in
the linker, we don't really have room for any non-essential overhead.

- Michael Spencer

>
> We could come up with a simpler pass for Layout(to sort atoms by file
> ordinal).
>
> What do you think ?
>
> Shankar Easwaran
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
> the Linux Foundation
>



More information about the llvm-dev mailing list