[clang] [llvm] [MC,llvm-readobj,yaml2obj] Support CREL relocation format (PR #91280)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun May 19 11:38:09 PDT 2024


================
@@ -123,6 +123,12 @@ class ContiguousBlobAccumulator {
     return encodeULEB128(Val, OS);
   }
 
+  unsigned writeSLEB128(int64_t Val) {
+    if (!checkLimit(10))
----------------
MaskRay wrote:

Yes, LEB128 representing 64-bit integer needs at most 10 bytes.
I added a change detector test to `relocation-crel.yaml` to catch the case.

----

The limit in writeULEB128 is incorrect, which can be fixed separately.

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


More information about the llvm-commits mailing list