[all-commits] [llvm/llvm-project] 78859f: [lld][LoongArch] Support the R_LARCH_{ADD, SUB}_ULE...

Jinyang He via All-commits all-commits at lists.llvm.org
Tue Mar 12 17:48:07 PDT 2024


  Branch: refs/heads/release/18.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 78859f118a6b4c7b06c543c7794c59befdc78924
      https://github.com/llvm/llvm-project/commit/78859f118a6b4c7b06c543c7794c59befdc78924
  Author: Jinyang He <hejinyang at loongson.cn>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M lld/ELF/Arch/LoongArch.cpp
    A lld/test/ELF/loongarch-reloc-leb128.s

  Log Message:
  -----------
  [lld][LoongArch] Support the R_LARCH_{ADD,SUB}_ULEB128 relocation types (#81133)

For a label difference like `.uleb128 A-B`, MC generates a pair of
R_LARCH_{ADD,SUB}_ULEB128 if A-B cannot be folded as a constant. GNU
assembler generates a pair of relocations in more cases (when A or B is
in a code section with linker relaxation). It is similar to RISCV.

R_LARCH_{ADD,SUB}_ULEB128 relocations are created by Clang and GCC in
`.gcc_except_table` and other debug sections with linker relaxation
enabled. On LoongArch, first read the buf and count the available space.
Then add or sub the value. Finally truncate the expected value and fill
it into the available space.

(cherry picked from commit eaa9ef678c63bf392ec2d5b736605db7ea7e7338)



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