[PATCH] add support for LayoutAfter/LayoutBefore references
Shankar Kalpathi Easwaran
shankarke at gmail.com
Thu Feb 7 11:53:36 PST 2013
================
Comment at: include/lld/Core/Reference.h:69-71
@@ +68,5 @@
+ return kindInGroup;
+ else if (kindString == "layoutbefore")
+ return kindLayoutBefore;
+ else if (kindString == "layoutafter")
+ return kindLayoutAfter;
----------------
Michael Spencer wrote:
> Missing '-'
Ok.
================
Comment at: include/lld/Passes/Passes.h:1-14
@@ +1,14 @@
+//===------ Passes/Passes.h - A Uber header file containing all passes----===//
+//
+// The LLVM Linker
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLD_LIB_PASSES_ALL_PASSES
+#define LLD_LIB_PASSES_ALL_PASSES
+
+#include "LayoutPass.h"
+
+#endif
----------------
Michael Spencer wrote:
> Clients should include the passes they need.
Ok. Will remove this file.
================
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:
> Aren't these completely redundant?
This is the layout before reference. This is needed to make the atoms stay in the same section.
================
Comment at: lib/ReaderWriter/ELF/File.h:330
@@ -298,3 +329,3 @@
for (auto &ri : _references) {
- const Elf_Sym *Symbol = _objFile->getElfSymbol(ri->targetSymbolIndex());
- ri->setTarget(findAtom(Symbol));
+ if (ri->kind() > lld::Reference::kindLayoutBefore) {
+ const Elf_Sym *Symbol = _objFile->getElfSymbol(ri->targetSymbolIndex());
----------------
Michael Spencer wrote:
> It's not obvious that this means "if it's not a core reference kind". We should have a kindTargetLow = 0.
Ok, will add that.
================
Comment at: lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp:96-97
@@ -95,2 +95,4 @@
break;
- default: {
+ case lld::Reference::kindLayoutAfter:
+ case lld::Reference::kindLayoutBefore:
+ break;
----------------
Michael Spencer wrote:
> This needs to include in group. Same for the other target infos.
Ok.
================
Comment at: lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp:99
@@ -98,3 +98,3 @@
}
- // Runtime only relocations. Ignore here.
+ // Runtime only relocations. Ignore here.
case R_X86_64_IRELATIVE:
----------------
Michael Spencer wrote:
> This formatting changes is wrong.
Ok.
http://llvm-reviews.chandlerc.com/D373
More information about the llvm-commits
mailing list