[PATCH] D34692: [LLD][ELF] Add support for multiple passes to createThunks()

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 08:17:18 PDT 2017


peter.smith created this revision.
Herald added a subscriber: emaste.

This change allows Thunks to be added on multiple passes. To do this we must merge only the thunks added in each pass, and deal with thunks that have
drifted out of range of their callers. A thunk may end out of range of its caller if enough thunks are added in between the caller and the thunk. To handle this we create another thunk.

This is patch 9/11 of range thunks. It is dependent on all previous patches https://reviews.llvm.org/D34691 and its dependencies. It is the last implementation patch, the remaining couple are test cases.

The most important changes are:

- If a call to an existing thunk created on the last pass is now out of range, we redirect the relocation back to the original caller
- With multiple passes we may be inserting Thunks into existing ThunkSections without creating any new ThunkSections so we can't use a count of created thunk sections to determine if we need another pass.


https://reviews.llvm.org/D34692

Files:
  ELF/Relocations.cpp
  ELF/Relocations.h
  ELF/Thunks.cpp
  ELF/Thunks.h
  ELF/Writer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34692.104174.patch
Type: text/x-patch
Size: 9446 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170627/8c6d10aa/attachment.bin>


More information about the llvm-commits mailing list