@@ -77,7 +77,7 @@ InputSectionBase::InputSectionBase(InputFile *file, uint64_t flags,
7777 // longer supported.
7878 if (flags & SHF_COMPRESSED) {
7979 Ctx &ctx = file->ctx ;
80- invokeELFT (parseCompressedHeader,);
80+ invokeELFT (parseCompressedHeader, ctx );
8181 }
8282}
8383
@@ -251,7 +251,8 @@ OutputSection *SectionBase::getOutputSection() {
251251// When a section is compressed, `rawData` consists with a header followed
252252// by zlib-compressed data. This function parses a header to initialize
253253// `uncompressedSize` member and remove the header from `rawData`.
254- template <typename ELFT> void InputSectionBase::parseCompressedHeader () {
254+ template <typename ELFT>
255+ void InputSectionBase::parseCompressedHeader (Ctx &ctx) {
255256 flags &= ~(uint64_t )SHF_COMPRESSED;
256257
257258 // New-style header
@@ -639,7 +640,7 @@ static uint64_t getARMStaticBase(const Symbol &sym) {
639640//
640641// This function returns the R_RISCV_PCREL_HI20 relocation from the
641642// R_RISCV_PCREL_LO12 relocation.
642- static Relocation *getRISCVPCRelHi20 (const InputSectionBase *loSec,
643+ static Relocation *getRISCVPCRelHi20 (Ctx &ctx, const InputSectionBase *loSec,
643644 const Relocation &loReloc) {
644645 uint64_t addend = loReloc.addend ;
645646 Symbol *sym = loReloc.sym ;
@@ -850,7 +851,7 @@ uint64_t InputSectionBase::getRelocTargetVA(Ctx &ctx, const Relocation &r,
850851 return getAArch64Page (val) - getAArch64Page (p);
851852 }
852853 case R_RISCV_PC_INDIRECT: {
853- if (const Relocation *hiRel = getRISCVPCRelHi20 (this , r))
854+ if (const Relocation *hiRel = getRISCVPCRelHi20 (ctx, this , r))
854855 return getRelocTargetVA (ctx, *hiRel, r.sym ->getVA (ctx));
855856 return 0 ;
856857 }
@@ -1369,8 +1370,9 @@ void EhInputSection::split(ArrayRef<RelTy> rels) {
13691370 d = d.slice (size);
13701371 }
13711372 if (msg)
1372- Err (ctx) << " corrupted .eh_frame: " << Twine (msg) << " \n >>> defined in "
1373- << getObjMsg (d.data () - content ().data ());
1373+ Err (file->ctx ) << " corrupted .eh_frame: " << Twine (msg)
1374+ << " \n >>> defined in "
1375+ << getObjMsg (d.data () - content ().data ());
13741376}
13751377
13761378// Return the offset in an output section for a given input offset.
0 commit comments