[lld] r276731 - [ELF/Linkerscript] Remove special handling of TLS/NOTE/RELRO sections (patch from ruiu)
Eugene Leviant via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 26 00:20:40 PDT 2016
Author: evgeny777
Date: Tue Jul 26 02:20:40 2016
New Revision: 276731
URL: http://llvm.org/viewvc/llvm-project?rev=276731&view=rev
Log:
[ELF/Linkerscript] Remove special handling of TLS/NOTE/RELRO sections (patch from ruiu)
Modified:
lld/trunk/ELF/LinkerScript.cpp
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=276731&r1=276730&r2=276731&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Jul 26 02:20:40 2016
@@ -256,9 +256,6 @@ template <class ELFT>
std::vector<PhdrEntry<ELFT>>
LinkerScript<ELFT>::createPhdrs(ArrayRef<OutputSectionBase<ELFT> *> Sections) {
std::vector<PhdrEntry<ELFT>> Ret;
- PhdrEntry<ELFT> *TlsPhdr = nullptr;
- PhdrEntry<ELFT> *NotePhdr = nullptr;
- PhdrEntry<ELFT> *RelroPhdr = nullptr;
for (const PhdrsCommand &Cmd : Opt.PhdrsCommands) {
Ret.emplace_back(Cmd.Type, Cmd.Flags == UINT_MAX ? PF_R : Cmd.Flags);
@@ -280,15 +277,6 @@ LinkerScript<ELFT>::createPhdrs(ArrayRef
Phdr.add(Out<ELFT>::Dynamic);
}
break;
- case PT_TLS:
- TlsPhdr = &Phdr;
- break;
- case PT_NOTE:
- NotePhdr = &Phdr;
- break;
- case PT_GNU_RELRO:
- RelroPhdr = &Phdr;
- break;
case PT_GNU_EH_FRAME:
if (!Out<ELFT>::EhFrame->empty() && Out<ELFT>::EhFrameHdr) {
Phdr.H.p_flags = toPhdrFlags(Out<ELFT>::EhFrameHdr->getFlags());
@@ -304,12 +292,6 @@ LinkerScript<ELFT>::createPhdrs(ArrayRef
if (!(Sec->getFlags() & SHF_ALLOC))
break;
- if (TlsPhdr && (Sec->getFlags() & SHF_TLS))
- TlsPhdr->add(Sec);
-
- if (!needsPtLoad<ELFT>(Sec))
- continue;
-
std::vector<size_t> PhdrIds = getPhdrIndices(Sec->getName());
if (!PhdrIds.empty()) {
// Assign headers specified by linker script
@@ -328,11 +310,6 @@ LinkerScript<ELFT>::createPhdrs(ArrayRef
}
Load->add(Sec);
}
-
- if (RelroPhdr && isRelroSection(Sec))
- RelroPhdr->add(Sec);
- if (NotePhdr && Sec->getType() == SHT_NOTE)
- NotePhdr->add(Sec);
}
return Ret;
}
More information about the llvm-commits
mailing list