[all-commits] [llvm/llvm-project] 5e87f8: [ELF] Add target-specific relocation scanning for ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Feb 14 17:13:57 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5e87f8147d680f340948d428f44b93a239a22464
      https://github.com/llvm/llvm-project/commit/5e87f8147d680f340948d428f44b93a239a22464
  Author: Fangrui Song <i at maskray.me>
  Date:   2026-02-15 (Sun, 15 Feb 2026)

  Changed paths:
    M lld/ELF/Arch/PPC.cpp
    M lld/ELF/InputSection.cpp
    M lld/ELF/Relocations.cpp
    M lld/ELF/Relocations.h

  Log Message:
  -----------
  [ELF] Add target-specific relocation scanning for PPC32 (#181517)

Implement PPC::scanSectionImpl, following the pattern established for
x86 (#178846) and PPC64 (#181496). This merges the getRelExpr and TLS
handling for SHF_ALLOC sections into the target-specific scanner,
enabling devirtualization and eliminating abstraction overhead.

- Inline relocation classification into scanSectionImpl with a switch
  on relocation type, replacing the generic rs.scan() path.
- Use processR_PC/processR_PLT_PC for common PC-relative and PLT
  relocations.
- Handle R_PPC_PLTREL24 inline with addend masking via processAux,
  removing the EM_PPC special case from process().
- Handle TLS GD/LD/IE directly, eliminating handleTlsRelocation,
  getTlsGdRelaxSkip, and adjustTlsExpr overrides. Use handleTlsIe
  for TLS IE, and handleTlsGd for R_PPC_GOT_TLSGD16.
- Use R_DTPREL unconditionally for DTPREL relocations, removing
  R_RELAX_TLS_LD_TO_LE_ABS (PPC32 was the only user).
- Move TLS relaxation dispatch from relocateAlloc into relocate,
  removing the relocateAlloc override.
- Simplify getRelExpr to only handle relocations needed by
  relocateNonAlloc and .eh_frame.



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