From: Eugene Leviant Date: Tue, 26 Jul 2016 07:20:40 +0000 (+0000) Subject: [ELF/Linkerscript] Remove special handling of TLS/NOTE/RELRO sections (patch from... X-Git-Tag: llvmorg-4.0.0-rc1~14205 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9d897c7a7ad3d44afd19b2ed850478b943d7352;p=platform%2Fupstream%2Fllvm.git [ELF/Linkerscript] Remove special handling of TLS/NOTE/RELRO sections (patch from ruiu) llvm-svn: 276731 --- diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 785a3f6..472a374 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -256,9 +256,6 @@ template std::vector> LinkerScript::createPhdrs(ArrayRef *> Sections) { std::vector> Ret; - PhdrEntry *TlsPhdr = nullptr; - PhdrEntry *NotePhdr = nullptr; - PhdrEntry *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::createPhdrs(ArrayRef *> Sections) { Phdr.add(Out::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::EhFrame->empty() && Out::EhFrameHdr) { Phdr.H.p_flags = toPhdrFlags(Out::EhFrameHdr->getFlags()); @@ -304,12 +292,6 @@ LinkerScript::createPhdrs(ArrayRef *> Sections) { if (!(Sec->getFlags() & SHF_ALLOC)) break; - if (TlsPhdr && (Sec->getFlags() & SHF_TLS)) - TlsPhdr->add(Sec); - - if (!needsPtLoad(Sec)) - continue; - std::vector PhdrIds = getPhdrIndices(Sec->getName()); if (!PhdrIds.empty()) { // Assign headers specified by linker script @@ -328,11 +310,6 @@ LinkerScript::createPhdrs(ArrayRef *> Sections) { } Load->add(Sec); } - - if (RelroPhdr && isRelroSection(Sec)) - RelroPhdr->add(Sec); - if (NotePhdr && Sec->getType() == SHT_NOTE) - NotePhdr->add(Sec); } return Ret; }