[PATCH] add support for LayoutAfter/LayoutBefore references

Shankar Kalpathi Easwaran shankarke at gmail.com
Tue Feb 12 10:54:16 PST 2013



================
Comment at: lib/ReaderWriter/ELF/File.h:307-316
@@ -288,1 +306,12 @@
 
+        // If we are inserting a followOn reference, lets add a precededBy 
+        // reference too
+        if (followOn) {
+          ELFReference<ELFT> *precededBy = nullptr;
+          followOn->setTarget(newAtom);
+          precededBy = new (_readerStorage)
+              ELFReference<ELFT>(lld::Reference::kindLayoutBefore);
+          precededBy->setTarget(previous_atom);
+          newAtom->addReference(precededBy);
+        }
+
----------------
Michael Spencer wrote:
> Shankar Kalpathi Easwaran wrote:
> > Michael Spencer wrote:
> > > Aren't these completely redundant?
> > This is the layout before reference. This is needed to make the atoms stay in the same section.
> Yes, but there's already the layout-after reference. Is that not enough to actually make it be directly after?
This is to make it work with garbage collection.


http://llvm-reviews.chandlerc.com/D373



More information about the llvm-commits mailing list