[PATCH] D22683: [ELF] Symbol assignment within input section list

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 04:38:59 PDT 2016


evgeny777 added inline comments.

================
Comment at: ELF/LinkerScript.h:155
@@ -153,2 +154,3 @@
   uintX_t Dot;
+  std::vector<std::unique_ptr<InputSectionBase<ELFT>>> Synthetics;
 };
----------------
ruiu wrote:
> evgeny777 wrote:
> > ruiu wrote:
> > > It seems you are storing only unique_ptr<SymbolInputSection> to this vector. Why don't you use SymbolInputSection instead of InputSectionBase?
> > Just because I wanted to keep this class local to LinkerScript without any forward declarations in header file. But can change this of course.
> I think adding a forward declaration would be better.
I tried it, but looks like forward declaration is not enough, because elements are wrapped inside unique_ptr<T>. To my understanding there are two alternatives:
a) Use raw pointers instead of unique_ptr<T>
b) Put SymbolInputSection<ELFT> declaration to LinkerScript.h (or even InputSection.h). This means explicit template instantiations should be added as well.

If this is really needed please suggest the correct way of implementation.


https://reviews.llvm.org/D22683





More information about the llvm-commits mailing list