[ELF] - Linkerscript: accept integer values for PHDRS types.
Both gold and ld accepts integers instead of named constants for PHDRS. Patch adds support for that. Differential revision: https://reviews.llvm.org/D25549 llvm-svn: 284470
This commit is contained in:
@@ -1706,8 +1706,14 @@ std::vector<StringRef> ScriptParser::readOutputSectionPhdrs() {
|
||||
return Phdrs;
|
||||
}
|
||||
|
||||
// Read a program header type name. The next token must be a
|
||||
// name of a program header type or a constant (e.g. "0x3").
|
||||
unsigned ScriptParser::readPhdrType() {
|
||||
StringRef Tok = next();
|
||||
uint64_t Val;
|
||||
if (readInteger(Tok, Val))
|
||||
return Val;
|
||||
|
||||
unsigned Ret = StringSwitch<unsigned>(Tok)
|
||||
.Case("PT_NULL", PT_NULL)
|
||||
.Case("PT_LOAD", PT_LOAD)
|
||||
|
||||
Reference in New Issue
Block a user