[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

@@ -1487,7 +1487,7 @@ LinkerScript::assignAddresses() {
dot = config->imageBase.value_or(0);
} else {
// Assign addresses to headers right now.
dot = target->getImageBase();
dot = ctx.target->getImageBase();
ctx.out.elfHeader->addr = dot;
ctx.out.programHeaders->addr = dot + ctx.out.elfHeader->size;
dot += getHeaderSize();