[all-commits] [llvm/llvm-project] ab12b4: [NFCI][ELF] Store DynamicReloc Kind as two bools

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


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ab12b43047fb3cb1fd80a508299c4a553065b023
      https://github.com/llvm/llvm-project/commit/ab12b43047fb3cb1fd80a508299c4a553065b023
  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] Store DynamicReloc Kind as two bools

Aside from Computed, Kind is now just AddendOnly and AgainstSymbol, so
it's really just a bool reflecting whether the resulting ELF relocation
should reference the symbol or not. Refactor DynamicReloc's storage to
reflect this, splitting Computed out into its own orthogonal isFinal
bool. As part of this, rename computeRaw to finalize to reflect that
it's side-effecting.

This also allows needsDynSymIndex() to work even after finalize(), so
drop the existing assertion.

A future commit will refact the DynamicReloc API to take isAgainstSymbol
directly now the enum serves little purpose, as a more invasive,
mechanical change. For this commit we keep DynamicReloc::Kind as the
external API.

Reviewers: MaskRay, arichardson

Reviewed By: MaskRay, arichardson

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



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