Page MenuHomePhabricator

[LLD][ELF] Record created ThunkSections in InputSectionDescription [NFC]

Authored by peter.smith on Sep 12 2017, 7:22 AM.



This is a refactoring change split out from D34689. It implements the suggestion to move ThunkCreator's map from std::vector<InputSection *> * to std::vector<ThunkSection *> to a vector<ThunkSection *> in InputSectionDescription. This patch implements just this refactoring. There are quite a lot of small changes involved although most are mechanical in nature. Notable changes:

  • We must now iterate over the InputSectionDescription to find the new Thunks rather than iterating over the map. I've modified forEachExecInputSection to be forEachInputSectionDescription so this can be used in mergeThunks.
  • We cannot clear the InputSectionDescription->ThunkSections within the forEachInputSectionDescription within createThunks as the Mips Thunks are inserted in the callee's InputSectionDescription. I've chosen to clear it after merging all the Thunks.

Diff Detail


Event Timeline

peter.smith created this revision.Sep 12 2017, 7:22 AM
pcc added a subscriber: pcc.Oct 10 2017, 4:47 PM
pcc added inline comments.
124 ↗(On Diff #114830)

This should be a struct, otherwise clang will warn.

Thanks very much for spotting that. Updated patch to fix and to rebase in light of recent refactoring.

Rebase in light of recent refactoring changes to RelType. No other changes.

ruiu accepted this revision.Oct 25 2017, 8:36 PM


This revision is now accepted and ready to land.Oct 25 2017, 8:36 PM
This revision was automatically updated to reflect the committed changes.