[all-commits] [llvm/llvm-project] c512d9: MC: Generalize RISCV/LoongArch handleAddSubRelocat...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun May 18 18:08:58 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c512d951861c9e35649b6c9672c227244bb9b6be
      https://github.com/llvm/llvm-project/commit/c512d951861c9e35649b6c9672c227244bb9b6be
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-05-18 (Sun, 18 May 2025)

  Changed paths:
    M llvm/include/llvm/MC/MCAsmBackend.h
    M llvm/include/llvm/MC/MCAssembler.h
    M llvm/lib/MC/ELFObjectWriter.cpp
    M llvm/lib/MC/MCAsmBackend.cpp
    M llvm/lib/MC/MCAssembler.cpp
    M llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
    M llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp
    M llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.h
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h

  Log Message:
  -----------
  MC: Generalize RISCV/LoongArch handleAddSubRelocations and AVR shouldForceRelocation

Introduce MCAsmBackend::addReloc to manage relocation appending.
The default implementation uses shouldForceRelocation to check
unresolved fixups and calls recordRelocation to append a relocation when
needed.

RISCV and LoongArch override addReloc to handle ADD/SUB relocations,
with potential support for RELAX relocations in the future.

AVR overrides addReloc to customize shouldForceRelocation behavior
(#121498).

applyFixup is moved into evaluateFixup.



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