forked from OSchip/llvm-project
Rename ignoreInterpSection -> needsInterpSection.
This should improve consistency. Also added comment. llvm-svn: 315169
This commit is contained in:
parent
0ae2c24c5d
commit
e03ba02348
|
@ -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 true;
|
||||
return false;
|
||||
}
|
||||
|
||||
ExprValue LinkerScript::getSymbolValue(const Twine &Loc, StringRef S) {
|
||||
|
|
|
@ -248,7 +248,7 @@ public:
|
|||
void adjustSectionsAfterSorting();
|
||||
|
||||
std::vector<PhdrEntry *> createPhdrs();
|
||||
bool ignoreInterpSection();
|
||||
bool needsInterpSection();
|
||||
|
||||
bool shouldKeep(InputSectionBase *S);
|
||||
void assignOffsets(OutputSection *Sec);
|
||||
|
|
|
@ -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(); }
|
||||
|
|
Loading…
Reference in New Issue