[all-commits] [llvm/llvm-project] dfe4ca: [RISCV][lld] Set the type of TLSDESC relocation's ...

Paul Kirth via All-commits all-commits at lists.llvm.org
Fri Mar 22 12:28:03 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dfe4ca9b7f4a422500d78280dc5eefd1979939e6
      https://github.com/llvm/llvm-project/commit/dfe4ca9b7f4a422500d78280dc5eefd1979939e6
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2024-03-22 (Fri, 22 Mar 2024)

  Changed paths:
    M lld/ELF/Relocations.cpp
    M lld/test/ELF/riscv-tlsdesc-relax.s
    M lld/test/ELF/riscv-tlsdesc.s
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp

  Log Message:
  -----------
  [RISCV][lld] Set the type of TLSDESC relocation's referenced local symbol to STT_NOTYPE

When adding fixups for RISCV_TLSDESC_ADD_LO and RISCV_TLSDESC_LOAD_LO,
the local label added for RISCV TLSDESC relocations have STT_TLS set,
which is incorrect. Instead, these labels should have `STT_NOTYPE`.

This patch stops adding such fixups and avoid setting the STT_TLS on
these symbols. Failing to do so can cause LLD to emit an error `has an
STT_TLS symbol but doesn't have an SHF_TLS section`. We additionally,
adjust how LLD services these relocations to avoid errors with
incompatible relocation and symbol types.

Reviewers: topperc, MaskRay

Reviewed By: MaskRay

Pull Request: https://github.com/llvm/llvm-project/pull/85817



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list