@@ -31,7 +31,7 @@ uint64_t elf::getAArch64Page(uint64_t expr) {
3131namespace {
3232class AArch64 : public TargetInfo {
3333public:
34- AArch64 ();
34+ AArch64 (Ctx & );
3535 RelExpr getRelExpr (RelType type, const Symbol &s,
3636 const uint8_t *loc) const override ;
3737 RelType getDynRel (RelType type) const override ;
@@ -76,7 +76,7 @@ static uint64_t getBits(uint64_t val, int start, int end) {
7676 return (val >> start) & mask;
7777}
7878
79- AArch64::AArch64 () {
79+ AArch64::AArch64 (Ctx &ctx) : TargetInfo(ctx ) {
8080 copyRel = R_AARCH64_COPY;
8181 relativeRel = R_AARCH64_RELATIVE;
8282 iRelativeRel = R_AARCH64_IRELATIVE;
@@ -960,7 +960,7 @@ void AArch64::relocateAlloc(InputSectionBase &sec, uint8_t *buf) const {
960960namespace {
961961class AArch64BtiPac final : public AArch64 {
962962public:
963- AArch64BtiPac ();
963+ AArch64BtiPac (Ctx & );
964964 void writePltHeader (uint8_t *buf) const override ;
965965 void writePlt (uint8_t *buf, const Symbol &sym,
966966 uint64_t pltEntryAddr) const override ;
@@ -971,7 +971,7 @@ class AArch64BtiPac final : public AArch64 {
971971};
972972} // namespace
973973
974- AArch64BtiPac::AArch64BtiPac () {
974+ AArch64BtiPac::AArch64BtiPac (Ctx &ctx) : AArch64(ctx ) {
975975 btiHeader = (ctx.arg .andFeatures & GNU_PROPERTY_AARCH64_FEATURE_1_BTI);
976976 // A BTI (Branch Target Indicator) Plt Entry is only required if the
977977 // address of the PLT entry can be taken by the program, which permits an
@@ -1176,12 +1176,12 @@ void lld::elf::createTaggedSymbols(const SmallVector<ELFFileBase *, 0> &files) {
11761176 }
11771177}
11781178
1179- TargetInfo *elf::getAArch64TargetInfo () {
1179+ TargetInfo *elf::getAArch64TargetInfo (Ctx &ctx ) {
11801180 if ((ctx.arg .andFeatures & GNU_PROPERTY_AARCH64_FEATURE_1_BTI) ||
11811181 ctx.arg .zPacPlt ) {
1182- static AArch64BtiPac t;
1182+ static AArch64BtiPac t (ctx) ;
11831183 return &t;
11841184 }
1185- static AArch64 t;
1185+ static AArch64 t (ctx) ;
11861186 return &t;
11871187}
0 commit comments