[lld] [lld][LoongArch] Support the R_LARCH_{ADD,SUB}_ULEB128 relocation types (PR #81133)

Lu Weining via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 18 02:29:56 PST 2024


================
@@ -153,6 +154,22 @@ static bool isJirl(uint32_t insn) {
   return (insn & 0xfc000000) == JIRL;
 }
 
+static void handleUleb128(uint8_t *loc, uint64_t val) {
+  const char *err = nullptr;
+  uint32_t count, maxcount = 1 + (config->is64 ? 64 : 32) / 7;
+  uint64_t mask = config->is64 ? -1 : -1;
----------------
SixWeining wrote:

1. for the last `-1`: did you mean `-1u`?
2. We can define `mask` before using it. (line 166).

https://github.com/llvm/llvm-project/pull/81133


More information about the llvm-commits mailing list