[ELF] Ignore .interp section in case linker script specifies PHDRS without PT_INTERP

llvm-svn: 278781
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 108ca54..5a39559 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -105,7 +105,8 @@
 
 template <class ELFT> static bool needsInterpSection() {
   return !Symtab<ELFT>::X->getSharedFiles().empty() &&
-         !Config->DynamicLinker.empty();
+         !Config->DynamicLinker.empty() &&
+         !Script<ELFT>::X->ignoreInterpSection();
 }
 
 template <class ELFT> void elf::writeResult() {