@@ -553,7 +553,7 @@ void EhFrameSection::finalizeContents() {
553553// to get an FDE from an address to which FDE is applied. This function
554554// returns a list of such pairs.
555555SmallVector<EhFrameSection::FdeData, 0 > EhFrameSection::getFdeData () const {
556- uint8_t *buf = Out:: bufferStart + getParent ()->offset + outSecOff;
556+ uint8_t *buf = ctx. bufferStart + getParent ()->offset + outSecOff;
557557 SmallVector<FdeData, 0 > ret;
558558
559559 uint64_t va = getPartition ().ehFrameHdr ->getVA ();
@@ -1493,17 +1493,17 @@ DynamicSection<ELFT>::computeContents() {
14931493 addInSec (DT_HASH, *part.hashTab );
14941494
14951495 if (isMain) {
1496- if (Out:: preinitArray) {
1497- addInt (DT_PREINIT_ARRAY, Out:: preinitArray->addr );
1498- addInt (DT_PREINIT_ARRAYSZ, Out:: preinitArray->size );
1496+ if (ctx. out . preinitArray ) {
1497+ addInt (DT_PREINIT_ARRAY, ctx. out . preinitArray ->addr );
1498+ addInt (DT_PREINIT_ARRAYSZ, ctx. out . preinitArray ->size );
14991499 }
1500- if (Out:: initArray) {
1501- addInt (DT_INIT_ARRAY, Out:: initArray->addr );
1502- addInt (DT_INIT_ARRAYSZ, Out:: initArray->size );
1500+ if (ctx. out . initArray ) {
1501+ addInt (DT_INIT_ARRAY, ctx. out . initArray ->addr );
1502+ addInt (DT_INIT_ARRAYSZ, ctx. out . initArray ->size );
15031503 }
1504- if (Out:: finiArray) {
1505- addInt (DT_FINI_ARRAY, Out:: finiArray->addr );
1506- addInt (DT_FINI_ARRAYSZ, Out:: finiArray->size );
1504+ if (ctx. out . finiArray ) {
1505+ addInt (DT_FINI_ARRAY, ctx. out . finiArray ->addr );
1506+ addInt (DT_FINI_ARRAYSZ, ctx. out . finiArray ->size );
15071507 }
15081508
15091509 if (Symbol *b = symtab.find (config->init ))
@@ -3631,7 +3631,7 @@ void EhFrameHeader::writeTo(uint8_t *buf) {
36313631// the starting PC from where FDEs covers, and the FDE's address.
36323632// It is sorted by PC.
36333633void EhFrameHeader::write () {
3634- uint8_t *buf = Out:: bufferStart + getParent ()->offset + outSecOff;
3634+ uint8_t *buf = ctx. bufferStart + getParent ()->offset + outSecOff;
36353635 using FdeData = EhFrameSection::FdeData;
36363636 SmallVector<FdeData, 0 > fdes = getPartition ().ehFrame ->getFdeData ();
36373637
@@ -4647,13 +4647,6 @@ static Defined *addOptionalRegular(StringRef name, SectionBase *sec,
46474647}
46484648
46494649template <class ELFT > void elf::createSyntheticSections () {
4650- // Initialize all pointers with NULL. This is needed because
4651- // you can call lld::elf::main more than once as a library.
4652- Out::tlsPhdr = nullptr ;
4653- Out::preinitArray = nullptr ;
4654- Out::initArray = nullptr ;
4655- Out::finiArray = nullptr ;
4656-
46574650 // Add the .interp section first because it is not a SyntheticSection.
46584651 // The removeUnusedSyntheticSections() function relies on the
46594652 // SyntheticSections coming last.
@@ -4670,8 +4663,8 @@ template <class ELFT> void elf::createSyntheticSections() {
46704663 if (config->zSectionHeader )
46714664 in.shStrTab = std::make_unique<StringTableSection>(" .shstrtab" , false );
46724665
4673- Out:: programHeaders = make<OutputSection>(" " , 0 , SHF_ALLOC);
4674- Out:: programHeaders->addralign = config->wordsize ;
4666+ ctx. out . programHeaders = make<OutputSection>(" " , 0 , SHF_ALLOC);
4667+ ctx. out . programHeaders ->addralign = config->wordsize ;
46754668
46764669 if (config->strip != StripPolicy::All) {
46774670 in.strTab = std::make_unique<StringTableSection>(" .strtab" , false );
0 commit comments