[llvm-dev] RFC: LLD range extension thunks

Sean Silva via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 18 21:50:32 PST 2017


On Wed, Jan 18, 2017 at 7:00 PM, Saleem Abdulrasool via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Out of curiosity, would this be done in a object format agnostic way?
> Windows ARM requires the same branch island support, and the logic for the
> detection and placement could be shared across ELF and COFF I suspect.
>

I think that most of the code changes needed for this are going to be just
refactoring to "put a loop around the Writer" and so is inherently specific
to ELF and COFF (since they have different Writer's). Initial thunk
placement heuristics/algorithms etc. are likely to be pretty simple (i.e.
too small lines of code to really share meaningfully). If we start doing
something really complicated for placing thunks it may make sense to factor
out so it can be shared, but it may end up like ICF where the algorithms we
use are the same, but the details of the data structures and semantics
differ enough that it's not clear if sharing them would be a net savings or
not.

-- Sean Silva


>
> On Wed, Jan 18, 2017 at 3:59 PM, Simon Atanasyan via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>>
>>
>> On Jan 19, 2017 2:48 AM, "Ed Maste" <emaste at freebsd.org> wrote:
>>
>> On 4 January 2017 at 13:34, Peter Smith via llvm-dev
>> <llvm-dev at lists.llvm.org> wrote:
>> > I'm about to start working on range extension thunks in lld. This is
>> > an attempt to summarize the approach I'd like to take and what the
>> > impact will be on lld outside of thunks.
>>
>> Now that LLD works well for FreeBSD/amd64 (and arm64 is very close)
>> I'm looking at other architectures, starting with mips64. The
>> statically-linked toolchain components currently fail to link with an
>> out of range jump, so I'm very interested in seeing this work
>> progress. Are you looking at only arm and AArch64? Once the
>> infrastructure is in I'll try to take a look at mips if nobody else
>> does first.
>>
>>
>> I'm waiting for this changes too. Now mips thunks places at the end of
>> the corresponding section. Not sure about FreeBSD but on Linux that leads
>> to incorrect code in case of static linking -- a thunk goes between crt*.o
>> files which needs to be "joined" together. Gnu linker puts thunks to the
>> separate section. We need to do the same thing.
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>>
>
>
> --
> Saleem Abdulrasool
> compnerd (at) compnerd (dot) org
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170118/2634ce4c/attachment-0001.html>


More information about the llvm-dev mailing list