[ELF] Move target to Ctx. NFC

Ctx was introduced in March 2022 as a more suitable place for such
singletons.

Follow-up to driver (2022-10) and script (2024-08).
This commit is contained in:
Fangrui Song
2024-08-21 23:53:36 -07:00
parent 5f6172f068
commit b4feb26606
21 changed files with 245 additions and 231 deletions

View File

@@ -1326,7 +1326,7 @@ Expr ScriptParser::readExpr1(Expr lhs, int minPrec) {
Expr ScriptParser::getPageSize() {
std::string location = getCurrentLocation();
return [=]() -> uint64_t {
if (target)
if (ctx.target)
return config->commonPageSize;
error(location + ": unable to calculate page size");
return 4096; // Return a dummy value.