[llvm] [LoongArch] Support R_LARCH_{ADD, SUB}_ULEB128 for .uleb128 and force relocs when sym is not in section (PR #76433)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 1 06:43:02 PST 2024


================
@@ -202,9 +217,27 @@ getRelocPairForSize(unsigned Size) {
     return std::make_pair(
         MCFixupKind(FirstLiteralRelocationKind + ELF::R_LARCH_ADD64),
         MCFixupKind(FirstLiteralRelocationKind + ELF::R_LARCH_SUB64));
+  case 128:
+    return std::make_pair(
+        MCFixupKind(FirstLiteralRelocationKind + ELF::R_LARCH_ADD_ULEB128),
+        MCFixupKind(FirstLiteralRelocationKind + ELF::R_LARCH_SUB_ULEB128));
   }
 }
 
+bool LoongArchAsmBackend::relaxLEB128(MCLEBFragment &LF, MCAsmLayout &Layout,
+                                      int64_t &Value, bool &UseZeroPad) const {
+  const MCExpr &Expr = LF.getValue();
+
----------------
MaskRay wrote:

delete blank line

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


More information about the llvm-commits mailing list