Changeset View
Changeset View
Standalone View
Standalone View
lld/trunk/ELF/Writer.cpp
Show First 20 Lines • Show All 1,174 Lines • ▼ Show 20 Lines | template <class ELFT> void Writer<ELFT>::finalizeSections() { | ||||
// jump instructions if jump targets are too far. Create thunks. | // jump instructions if jump targets are too far. Create thunks. | ||||
if (Target->NeedsThunks) { | if (Target->NeedsThunks) { | ||||
// FIXME: only ARM Interworking and Mips LA25 Thunks are implemented, | // FIXME: only ARM Interworking and Mips LA25 Thunks are implemented, | ||||
// these | // these | ||||
// do not require address information. To support range extension Thunks | // do not require address information. To support range extension Thunks | ||||
// we need to assign addresses so that we can tell if jump instructions | // we need to assign addresses so that we can tell if jump instructions | ||||
// are out of range. This will need to turn into a loop that converges | // are out of range. This will need to turn into a loop that converges | ||||
// when no more Thunks are added | // when no more Thunks are added | ||||
if (createThunks<ELFT>(OutputSections)) | ThunkCreator<ELFT> TC; | ||||
if (TC.createThunks(OutputSections)) | |||||
applySynthetic({In<ELFT>::MipsGot}, | applySynthetic({In<ELFT>::MipsGot}, | ||||
[](SyntheticSection *SS) { SS->updateAllocSize(); }); | [](SyntheticSection *SS) { SS->updateAllocSize(); }); | ||||
} | } | ||||
// Fill other section headers. The dynamic table is finalized | // Fill other section headers. The dynamic table is finalized | ||||
// at the end because some tags like RELSZ depend on result | // at the end because some tags like RELSZ depend on result | ||||
// of finalizing other sections. | // of finalizing other sections. | ||||
for (OutputSection *Sec : OutputSections) | for (OutputSection *Sec : OutputSections) | ||||
Sec->finalize<ELFT>(); | Sec->finalize<ELFT>(); | ||||
▲ Show 20 Lines • Show All 635 Lines • Show Last 20 Lines |