[PATCH v5 1/5] LoongArch: bfd: Add support for tls le relax.

Hannes Domani ssbssa@yahoo.de
Fri Dec 29 09:53:08 GMT 2023


 Am Donnerstag, 28. Dezember 2023, 04:41:38 MEZ hat changjiachen <changjiachen@stu.xupt.edu.cn> Folgendes geschrieben:

> Add tls le relax support and related relocs in bfd.
>
> New relocation related explanation can refer to the following url:
> https://github.com/loongson/la-abi-specs/blob/release/laelf.adoc
>
> This support does two main things:
>
> 1. Implement support for three new relocation items in bfd.
>
> The three new relocation items are shown below:
>
> R_LARCH_TLS_LE_ADD_R
> R_LARCH_TLS_LE_HI20_R
> R_LARCH_TLS_LE_LO12_R
>
> 2. ADD a new macro RELOCATE_TLS_TP32_HI20
>
> Handle problems caused by symbol extensions in TLS LE, The processing
> is similar to the macro RELOCATE_CALC_PC32_HI20 method.
>
> 3. Implement the tls le relax function.
>
> bfd/ChangeLog:
>
>     * bfd-in2.h: Add relocs related to tls le relax.
>     * elfnn-loongarch.c:
>     (loongarch_relax_tls_le): New function.
>     (RELOCATE_TLS_TP32_HI20): New macro.
>     (loongarch_elf_check_relocs): Add new reloc support.
>     (perform_relocation): Likewise.
>     (loongarch_elf_relocate_section): Handle new relocs related to relax.
>     (loongarch_elf_relax_section): Likewise.
>     * elfxx-loongarch.c:
>     (LOONGARCH_HOWTO (R_LARCH_TLS_LE_ADD_R)): New reloc how to type.
>     (LOONGARCH_HOWTO (R_LARCH_TLS_LE_HI20_R)): Likewise.
>     (LOONGARCH_HOWTO (R_LARCH_TLS_LE_LO12_R)): Likewise.
>     * libbfd.h: Add relocs related to tls le relax.
>     * reloc.c: Likewise.
> ---
> bfd/bfd-in2.h        |  4 +++
> bfd/elfnn-loongarch.c | 75 +++++++++++++++++++++++++++++++++++++++++++
> bfd/elfxx-loongarch.c | 55 ++++++++++++++++++++++++++++---
> bfd/libbfd.h          |  3 ++
> bfd/reloc.c          |  7 ++++
> 5 files changed, 139 insertions(+), 5 deletions(-)


When this patch was committed, it also added a bfd/.elfnn-loongarch.c.swp
file, and I doubt this was intentional.


Regards
Hannes


More information about the Binutils mailing list