Rename ignoreInterpSection -> needsInterpSection.

This should improve consistency. Also added comment.

llvm-svn: 315169
This commit is contained in:
Rui Ueyama 2017-10-08 03:52:15 +00:00
parent 0ae2c24c5d
commit e03ba02348
3 changed files with 11 additions and 8 deletions

View File

@ -841,15 +841,18 @@ std::vector<PhdrEntry *> LinkerScript::createPhdrs() {
return Ret;
}
bool LinkerScript::ignoreInterpSection() {
// Ignore .interp section in case we have PHDRS specification
// and PT_INTERP isn't listed.
// Returns true if we should emit an .interp section.
//
// We usually do. But if PHDRS commands are given, and
// no PT_INTERP is there, there's no place to emit an
// .interp, so we don't do that in that case.
bool LinkerScript::needsInterpSection() {
if (Opt.PhdrsCommands.empty())
return false;
return true;
for (PhdrsCommand &Cmd : Opt.PhdrsCommands)
if (Cmd.Type == PT_INTERP)
return false;
return true;
return false;
}
ExprValue LinkerScript::getSymbolValue(const Twine &Loc, StringRef S) {

View File

@ -248,7 +248,7 @@ public:
void adjustSectionsAfterSorting();
std::vector<PhdrEntry *> createPhdrs();
bool ignoreInterpSection();
bool needsInterpSection();
bool shouldKeep(InputSectionBase *S);
void assignOffsets(OutputSection *Sec);

View File

@ -117,7 +117,7 @@ StringRef elf::getOutputSectionName(StringRef Name) {
static bool needsInterpSection() {
return !SharedFiles.empty() && !Config->DynamicLinker.empty() &&
!Script->ignoreInterpSection();
Script->needsInterpSection();
}
template <class ELFT> void elf::writeResult() { Writer<ELFT>().run(); }