[PATCH] D13486: ELF2; Make singleton output sections globally accessible

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 11:37:25 PDT 2015


rafael added inline comments.

================
Comment at: ELF/Writer.cpp:129
@@ +128,3 @@
+  // Don't reorder because the order of initialization matters.
+  Out<ELFT>::Interp = new InterpSection<ELFT::Is64Bits>();
+  Out<ELFT>::StrTab = new StringTableSection<ELFT::Is64Bits>(false);
----------------
This is a leak, no?

Can the Out struct contain the sections themselves instead of pointers?
Failing that, could these be kept in Writer and have the writer constructor set the pointers in Out:

Out<ELFT>::StrTab = &StrTabSec;
...



http://reviews.llvm.org/D13486





More information about the llvm-commits mailing list