template <class ELFT>
StringRef LinkerScript<ELFT>::getOutputSection(InputSectionBase<ELFT> *S) {
for (SectionRule &R : Opt.Sections)
- if (R.match(S))
+ if (matchStr(R.SectionPattern, S->getSectionName()))
return R.Dest;
return "";
}
}
}
-template <class ELFT> bool SectionRule::match(InputSectionBase<ELFT> *S) {
- return matchStr(SectionPattern, S->getSectionName());
-}
-
class elf::ScriptParser : public ScriptParserBase {
typedef void (ScriptParser::*Handler)();
template <class ELFT> class OutputSectionBase;
// This class represents each rule in SECTIONS command.
-class SectionRule {
-public:
+struct SectionRule {
SectionRule(StringRef D, StringRef S)
: Dest(D), SectionPattern(S) {}
StringRef Dest;
-private:
StringRef SectionPattern;
};
ScriptConfiguration &Opt = *ScriptConfig;
int getSectionIndex(StringRef Name);
- SectionRule *find(InputSectionBase<ELFT> *S);
uint64_t evaluate(ArrayRef<StringRef> Tokens);
uint64_t parseExpr(ArrayRef<StringRef> &Tokens);