[PATCH] D14382: [ELF2] - Basic implementation of -r/--relocatable

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 15:16:21 PST 2016


rafael added inline comments.

================
Comment at: ELF/InputSection.h:95
@@ +94,3 @@
+  // sections.
+  InputSectionBase<ELFT> *RelocatingSection = nullptr;
+
----------------
Why do you need to store this? You can always use sh_info, no?
That way you don't add a field to every InputSectionBase.

================
Comment at: ELF/OutputSections.cpp:751
@@ +750,3 @@
+template <class ELFT>
+StaticRelocSection<ELFT>::StaticRelocSection(StringRef Name, uint32_t Type,
+                                             uintX_t Flags, bool IsRela)
----------------
This is remarkably similar to OutputSeciton. Can you use that? 

================
Comment at: ELF/OutputSections.cpp:763
@@ +762,3 @@
+  else if (RelocOutSec != Sec->RelocatingSection->OutSec)
+    error("Sections to which the relocations applies doesn`t match");
+
----------------
Can you get here? If so, add a test, if not, use an assert.


http://reviews.llvm.org/D14382





More information about the llvm-commits mailing list