[PATCH] D23201: [ELF] - Fix for: error "invalid section index: xxx" when linking FreeBSD kernel.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 11:04:32 PDT 2016


ruiu added a comment.

Now that I understand what kind of file you are trying to handle. This seems pretty weird. How does this happen? Do you know who created that file?


================
Comment at: ELF/InputFiles.cpp:345
@@ -344,3 +344,3 @@
   InputSectionBase<ELFT> *S = Sections[Index];
-  if (S == &InputSectionBase<ELFT>::Discarded)
+  if (!S || S == &InputSectionBase<ELFT>::Discarded)
     return S;
----------------
This is not a good place to fix it. Set InputSectionBase<ELFT>::Discarded to REL/RELA sections instead.


https://reviews.llvm.org/D23201





More information about the llvm-commits mailing list