This is an archive of the discontinued LLVM Phabricator instance.

[LLD][ELF] Convert Thunks to use InputSectionDescriptions
ClosedPublic

Authored by peter.smith on Jun 2 2017, 8:21 AM.

Details

Summary

Thunks are now generated per InputSectionDescription instead of per OutputSection. This allows created ThunkSections to be inserted directly into InputSectionDescription.

Changes in this patch:

  • Loop over InputSectionDescriptions to find relocations to Thunks
  • Generate a ThunkSection per InputSectionDescription
  • Remove synchronize() as we no longer need it
  • Move fabricateDefaultCommands() before createThunks

This is patch 3/3 of the conversion of ThunkCreator to insert Thunks into InputSectionDescription. The patch is dependent on the previous 2 refactoring patches on ThunkCreator D33832, D33834. In addition it is also dependent on D33772 SHF_LINK_ORDER sections using InputSectionDescriptions as we need that to be able to remove synchronize().

Diff Detail

Repository
rL LLVM

Event Timeline

peter.smith created this revision.Jun 2 2017, 8:21 AM

Rebase to account for changes in Writer.cpp (removal of fixSectionAlignments). Also took the opportunity to add a Mips linker script test.

Rebase to account for changes in writer.cpp

This revision was automatically updated to reflect the committed changes.