]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
RISC-V: Initial ld.bfd support for TLSDESC.
authorTatsuyuki Ishi <ishitatsuyuki@gmail.com>
Tue, 20 Feb 2024 17:55:52 +0000 (02:55 +0900)
committerNelson Chu <nelson@rivosinc.com>
Thu, 29 Feb 2024 07:02:55 +0000 (15:02 +0800)
commit159afbb7617d2c8a9cd3f3350374711f37f60442
treec6ca5d1b84b1c73cecd1bc918f75c4908e70f822
parente0f747d5e912f3a7115a578662a7a5a537cd0eae
RISC-V: Initial ld.bfd support for TLSDESC.

Only relocation handling for now; relaxation is not implemented yet.

bfd/
    * elfnn-riscv.c (riscv_elf_check_relocs): Record GOT reference and
    paired relocation for TLSDESC_HI20.
    (riscv_elf_adjust_dynamic_symbol): Allocate GOT and reloc slots for
    TLSDESC symbols.
    (riscv_elf_size_dynamic_sections): Likewise but for local symbols.
    (tlsdescoff): New helper to determine static addend for R_TLSDESC.
    (riscv_elf_relocate_section): Ignore TLSDESC_CALL reloc for now (it is
    relaxation only).
    Handle TLSDESC_{LOAD,ADD}_LO12 as paired pcrel relocs.
    For TLS GOT slot generation, generalize the logic to handle any
    combination of (GD, IE, TLSDESC).
    Add TLSDESC Rela generation.
    * ld/testsuite/ld-riscv-elf/tls*: Add TLSDESC instruction sequences
    next to the existing GD and IE sequences. Update expectations.
bfd/elfnn-riscv.c
ld/testsuite/ld-riscv-elf/tls.d
ld/testsuite/ld-riscv-elf/tls.s
ld/testsuite/ld-riscv-elf/tlsbin.d