[all-commits] [llvm/llvm-project] 0f5805: Convert TLS IE to LE in the normal or medium code ...

Zhaoxin Yang via All-commits all-commits at lists.llvm.org
Tue Mar 11 00:02:14 PDT 2025


  Branch: refs/heads/users/ylzsx/r-tls-ie-to-le-norelax
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f580567169ffbf1546a5389ab4b9f7d1fc07c71
      https://github.com/llvm/llvm-project/commit/0f580567169ffbf1546a5389ab4b9f7d1fc07c71
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M lld/ELF/Arch/LoongArch.cpp
    M lld/ELF/Relocations.cpp

  Log Message:
  -----------
  Convert TLS IE to LE in the normal or medium code model.

Original code sequence:
 * pcalau12i $a0, %ie_pc_hi20(sym)
 * ld.d      $a0, $a0, %ie_pc_lo12(sym)

The code sequence converted is as follows:
 * lu12i.w   $a0, %ie_pc_hi20(sym)  # le_hi20 != 0, otherwise NOP
 * ori $a0   $a0, %ie_pc_lo12(sym)

FIXME: When relaxation enables, redundant NOP can be removed. This will
be implemented in a future patch.

Note: In the normal or medium code model, original code sequence with
relocations can appear interleaved, because converted code sequence
calculates the absolute offset. However, in extreme code model, to
identify the current code model, the first four instructions with
relocations must appear consecutively.


  Commit: 441f1bc7fc4d0b9ff80d4456a64c3f56dd0479fc
      https://github.com/llvm/llvm-project/commit/441f1bc7fc4d0b9ff80d4456a64c3f56dd0479fc
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M lld/test/ELF/loongarch-tls-ie.s

  Log Message:
  -----------
  Test loongarch-tls-ie.s pass.


  Commit: d17de7816159c1b7cb20bb994f3c92c351bda849
      https://github.com/llvm/llvm-project/commit/d17de7816159c1b7cb20bb994f3c92c351bda849
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    A lld/test/ELF/loongarch-relax-tls-ie.s

  Log Message:
  -----------
  Add test loongarch-relax-tls-ie.s


  Commit: 20b544c6df789763518299ceb0183b870c223f0a
      https://github.com/llvm/llvm-project/commit/20b544c6df789763518299ceb0183b870c223f0a
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M lld/ELF/Relocations.cpp

  Log Message:
  -----------
  modify RE_LOONGARCH_GOT.


  Commit: 5dafc6640c355827ca9de75b2a29b617c909431d
      https://github.com/llvm/llvm-project/commit/5dafc6640c355827ca9de75b2a29b617c909431d
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M lld/ELF/Relocations.cpp

  Log Message:
  -----------
  Fix bug.


Compare: https://github.com/llvm/llvm-project/compare/31a9dab0eeb7...5dafc6640c35

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