[lld] r218847 - [ELF] Never mark the dynamic linker as DT_NEEDED
Rafael Auler
rafaelauler at gmail.com
Wed Oct 1 20:52:54 PDT 2014
Author: rafauler
Date: Wed Oct 1 22:52:54 2014
New Revision: 218847
URL: http://llvm.org/viewvc/llvm-project?rev=218847&view=rev
Log:
[ELF] Never mark the dynamic linker as DT_NEEDED
This patch adds logic to avoid putting the dynamic linker library (ld.so) as a
DT_NEEDED entry in the dynamic table. It should only appear in PT_INTERP.
This patch fixes SPEC programs 433, 445, 450, 453, 456, 462 when running on
Ubuntu Linux x86_64 and when linking SPEC programs with LLD and glibc 2.19.
http://reviews.llvm.org/D5573
Modified:
lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
Modified: lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h?rev=218847&r1=218846&r2=218847&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/OutputELFWriter.h Wed Oct 1 22:52:54 2014
@@ -19,6 +19,7 @@
#include "lld/ReaderWriter/Writer.h"
#include "llvm/ADT/StringSet.h"
+#include "llvm/Support/Path.h"
namespace lld {
namespace elf {
@@ -193,6 +194,8 @@ void OutputELFWriter<ELFT>::buildDynamic
if (isNeededTagRequired(sla))
_soNeeded.insert(sla->loadName());
}
+ // Never mark the dynamic linker as DT_NEEDED
+ _soNeeded.erase(sys::path::filename(_context.getInterpreter()));
for (const auto &loadName : _soNeeded) {
Elf_Dyn dyn;
dyn.d_tag = DT_NEEDED;
More information about the llvm-commits
mailing list