[all-commits] [llvm/llvm-project] 65d16a: [RISCV] Simplify fixup kinds that force relocations

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Apr 17 21:36:37 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 65d16a8101f98199b5d2505c1e9fdf2df519814b
      https://github.com/llvm/llvm-project/commit/65d16a8101f98199b5d2505c1e9fdf2df519814b
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-04-17 (Thu, 17 Apr 2025)

  Changed paths:
    M llvm/lib/MC/MCAssembler.cpp
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.h
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp

  Log Message:
  -----------
  [RISCV] Simplify fixup kinds that force relocations

For RELA targets, fixup kinds that force relocations (GOT, TLS, ALIGN,
RELAX, etc) can bypass `applyFixup` and be encoded as
`FirstRelocationKind+i`, as seen in LoongArch. This patch removes
redundant fixup kinds and adopts the `FirstRelocationKind+i` encoding.

The `llvm-mc -show-encoding` output no longer displays descriptive fixup
names, as this information is removed from
`RISCVAsmBackend::getFixupKindInfo`. While a backend hook could be added
to call `llvm::object::getELFRelocationTypeName`, it's unnecessary since
the relocation in `-filetype=obj` output is what truly matters.

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



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