This is an archive of the discontinued LLVM Phabricator instance.

[LLD][ELF] Introduce Thunk reuse compatibility

Authored by peter.smith on Apr 4 2017, 4:03 AM.



On ARM the interworking thunks are only produced for branch instructions that can't be changed into a blx instruction so only Thumb callers would call Thumb thunks and only ARM callers would call ARM thunks. With range extension thunks branch and link instructions may need a Thunk. These instructions can be rewritten as a blx and can use either ARM or Thumb thunks.

We introduce a compatibleWith() function so that a caller can check if an existing Thunk is compatible before reusing it.

Diff Detail

Event Timeline

peter.smith created this revision.Apr 4 2017, 4:03 AM
peter.smith updated this revision to Diff 94206.Apr 5 2017, 5:41 AM

Rebased to account for changes in D31654

peter.smith abandoned this revision.May 16 2017, 7:35 AM

I'm abandoning the range thunks implementation that inserts into OutputSections in favour of an implementation that inserts into InputSectionDescription.