SectionOrder vector was a part of LinkerScript class.
After commit of D18499 it can be removed because Locations vector
contains the same information and SectiorOrder is just a subset.
Differential D19171
[ELF] - Get rid of SectionOrder array. grimar on Apr 15 2016, 11:55 AM. Authored by
Details SectionOrder vector was a part of LinkerScript class. After commit of D18499 it can be removed because Locations vector
Diff Detail Event Timeline
Comment Actions This patch also fixes the section indexes. We should keep OutputSections order the same as Locations order because of code that assigns them: unsigned I = 1; for (OutputSectionBase<ELFT> *Sec : OutputSections) { Sec->SectionIndex = I++; Sec->setSHName(Out<ELFT>::ShStrTab->addString(Sec->getName())); } Comment Actions LGTM with a nit.
|
The return value will never overflow in reality, so let's use just int instead of uint32_t. Then you can report the absent key as just -1 instead of UINT32_MAX.