[PATCH] D11612: [lld][ELF2] Apply relocations.

Michael Spencer via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 16:56:11 PDT 2015


Bigcheese added inline comments.

================
Comment at: ELF/Chunks.h:81
@@ -81,3 +80,3 @@
 public:
-  SectionChunk(llvm::object::ELFFile<ELFT> *Obj, const Elf_Shdr *Header);
+  SectionChunk(ObjectFile<ELFT> *F, const Elf_Shdr *Header);
   size_t getSize() const override { return Header->sh_size; }
----------------
rafael wrote:
> Why do you need to pass an ObjectFile here?
Because we need to know which ObjectFile a section is from to get its relocations.

================
Comment at: ELF/InputFiles.cpp:35
@@ -34,2 +34,3 @@
   Chunks.reserve(Size);
+  SparseChunks.reserve(Size);
   for (const Elf_Shdr &Sec : ELFObj->sections()) {
----------------
rafael wrote:
> For SparseChunks you can use resize and drop the push_backs below.
I cleaned it up some. Using resize and array indexing was just as complicated.

================
Comment at: test/elf2/relocation.test:1
@@ +1,2 @@
+# RUN: yaml2obj -format elf %s -docnum 1 -o %t1obj
+# RUN: yaml2obj -format elf %s -docnum 2 -o %t2obj
----------------
rafael wrote:
> llvm-mc
This is testing explicit relocations. Assembly doesn't represent specific relocations, and it's not obvious what gets generated.


http://reviews.llvm.org/D11612





More information about the llvm-commits mailing list