[all-commits] [llvm/llvm-project] 0d81d3: [NFCI][ELF] Introduce explicit Computed state for ...

Jessica Clarke via All-commits all-commits at lists.llvm.org
Wed Jul 30 09:04:15 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d81d3c59a9f10cb4b7a1f6086ae42b7f59ad6d3
      https://github.com/llvm/llvm-project/commit/0d81d3c59a9f10cb4b7a1f6086ae42b7f59ad6d3
  Author: Jessica Clarke <jrtc27 at jrtc27.com>
  Date:   2025-07-30 (Wed, 30 Jul 2025)

  Changed paths:
    M lld/ELF/SyntheticSections.cpp
    M lld/ELF/SyntheticSections.h

  Log Message:
  -----------
  [NFCI][ELF] Introduce explicit Computed state for DynamicReloc

Currently we set the kind to AddendOnly in computeRaw() in order to
catch cases where we're not treating the DynamicReloc as computed.
Specifically, computeAddend() will then assert that sym is nullptr, so
can catch any subsequent calls for relocations that have sym set.
However, if the DynamicReloc was already AddendOnly (or
MipsMultiGotPage), we will silently allow this, which does work
correctly, but is not the intended use. We also cannot catch cases where
needsDynSymIndex() is called after this point, which would give a
misleading value if the kind were previously against a symbol.

By introducing a new (internal) Computed kind we can be explicit and add
more rigorous assertions, rather than abusing AddendOnly.

Reviewers: arichardson, MaskRay

Reviewed By: arichardson, MaskRay

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



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