[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 Sep 12 07:51:44 PDT 2017


peter.smith updated this revision to Diff 114838.
peter.smith added a comment.

Updated diff to implement the idea to use the pass number the ThunkSection was created in to indicate the ThunkSections that need to be merged (those created this pass). This has the advantage of only having one vector in InputSectionDescription.

> All of this wouldn't be necessary if you made these vectors members of `InputSectionDescription`, as @ruiu suggested in https://reviews.llvm.org/D34689, correct?

As I understand it we need some means to identify the existing ThunkSections that have already been inserted and the ThunkSections we have just created but not inserted yet. In the original implementation I used ThunkSections and the subset NewThunkSections to record the difference. I have a slight preference for recording the pass number in ThunkSections as this lessens the chance of ThunkSections and NewThunkSections being used inconsistently. I'm open to suggestions for better ways of doing this. One potential idea is to store the index or an iterator into the ThunkSections that records what has been inserted so far.


https://reviews.llvm.org/D34692

Files:
  ELF/LinkerScript.h
  ELF/Relocations.cpp
  ELF/Relocations.h
  ELF/Thunks.cpp
  ELF/Thunks.h
  ELF/Writer.cpp
  test/ELF/arm-thumb-condbranch-thunk.s
  test/ELF/arm-thumb-thunk-empty-pass.s
  test/ELF/arm-thunk-multipass.s
  test/ELF/arm-thunk-re-add.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34692.114838.patch
Type: text/x-patch
Size: 31263 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170912/360a7688/attachment.bin>


More information about the llvm-commits mailing list