This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold][aarch64]Patch to support 2 TLSLD relocations and change _TLS_MODULE_BASE_


> Also, in order to make LLVM generated code work, I always let
> _TLS_MODULE_BASE_ point to the beginning of TLS segment. The LLVM
> generated code directly uses _TLS_MODULE_BASE_ symbol, assuming it
> always points to the beginning of TLS segment.
>
> Without this patch, _TLS_MODULE_BASE_ pointed to the end of TLS
> segment if generating executable. This behavior was copied from gold
> x86 backend and arm backend, when I initially wrote this piece of
> code. Now I think maybe I was wrong. x86 does this way because @DTPOFF
> has historically been relaxed in main executables. There is no such a
> history on aarch64 backend. TLSLD_*_DTPREL relocations haven't been
> supported by bfd ld linker so far. I think as long as the calculation
> is consistent in gold, we are fine. If you have different opinion,
> please let me know.

Sounds good to me.

> 2015-03-28  Jing Yu  <jingyu@google.com>
>
>       * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
>       TLSLD_ADD_DTPREL_LO12_NC.
>       * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
>       _TLS_MODULE_BASE_ point to the start of tls segment.
>       (Target_aarch64::optimize_tls_reloc): Add cases for
>       R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
>       R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
>       (Target_aarch64::Scan::local): Likewise.
>       (Target_aarch64::Scan::global): Likewise.
>       (Target_aarch64::Relocate::relocate): Likewise.
>       (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
>       subtracting tls segment size from symbol value for TLSLD_*_DTPREL
>       relocations.

This is OK for trunk. Thanks!

Note that the long lines in aarch64-reloc.def got wrapped by the mail
system. It's probably best in the future to send the patch as an
attachment.

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]