[PATCH] D71143: [ELF][Hexagon] Add support for TLS IE relocations

Sid Manning via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 16:03:28 PST 2020


sidneym added a comment.

In D71143#1807026 <https://reviews.llvm.org/D71143#1807026>, @MaskRay wrote:

> In D71143#1806854 <https://reviews.llvm.org/D71143#1806854>, @sidneym wrote:
>
> > In D71143#1806565 <https://reviews.llvm.org/D71143#1806565>, @MaskRay wrote:
> >
> > > I'd like to ask some questions which can help understand the situation better.
> > >
> > > - Does Hexagon have a binutils port or an alternative linker?
> >
> >
> > The binutils port was never made public.  The internal linker can be downloaded with a click-thu license agreement, the same one needed to get to the ABI spec.  That linker is a branch of mclinker.
>
>
> Like @ruiu argued before, a click-thu license agreement may be unacceptable in many environments. I am also concerned whether a click-thru license agreement is considered 100% GPLv3 conformance.


All hexagon work on binutils/gcc was done during the GPLv2 timeframe.  The downloadable linker I'm referring to is a branch from the old mclinker project.

> 
> 
>>> - Is -pie and -shared used a lot on Hexagon?
>> 
>> -pie isn't but shared is.
>> 
>>> - How is Hexagon's dynamic loader ld.so implemented? Is the source code available?
>> 
>> The code isn't yet available from Qualcomm but we have a port of MUSL and I don't think much more than adding the #defines to reloc.h and the files dlsym.s/tlsdesc.s was done.  Nothing weird for hexagon.
> 
> The source code will be appreciated.

I agree and will make sure you are notified when it is available.

> 
> 
>>> - How is TLS going to be used on Hexagon?
>> 
>> There isn't anything out of the ordinary in how it is used and it is necessary for C++11 support.
>> 
>>> - Is text relocations acceptable?
>> 
>> No.  The reason I needed to add the -z notext in the -shared test was because technically the wrong relocations were being used.  I did that so that I could condense the IE patch into a single file testcase.
> 
> Not entirely wrong, and used in practice, e.g. libGL.so and libGLESv2.so use DT_STATIC_TLS. There are certain PC relative instructions, so `R_GOT` looks out-of-place to me. I hope this can be changed.




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71143/new/

https://reviews.llvm.org/D71143





More information about the llvm-commits mailing list