Simplify.
authorRui Ueyama <ruiu@google.com>
Thu, 26 Oct 2017 22:30:25 +0000 (22:30 +0000)
committerRui Ueyama <ruiu@google.com>
Thu, 26 Oct 2017 22:30:25 +0000 (22:30 +0000)
Because of the same reason as r316600, I don't think we need a guard
against empty relocations.

llvm-svn: 316710

lld/ELF/SyntheticSections.cpp

index 74b4085..e3798c8 100644 (file)
@@ -511,9 +511,7 @@ void EhFrameSection<ELFT>::addSection(InputSectionBase *C) {
   if (Sec->Pieces.empty())
     return;
 
-  if (Sec->NumRelocations == 0)
-    addSectionAux(Sec, makeArrayRef<Elf_Rela>(nullptr, nullptr));
-  else if (Sec->AreRelocsRela)
+  if (Sec->AreRelocsRela)
     addSectionAux(Sec, Sec->template relas<ELFT>());
   else
     addSectionAux(Sec, Sec->template rels<ELFT>());