[PATCH] D142879: [RISCV] Emit relocation for uleb128

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 14 23:50:03 PDT 2023


MaskRay added inline comments.


================
Comment at: llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp:210
+  const MCExpr *A, *B;
+  if (!EnableULEB128Reloc || !requiresFixups(getContext(), Value, A, B))
+    return MCELFStreamer::emitULEB128Value(Value);
----------------
kito-cheng wrote:
> MaskRay wrote:
> > evaluateAsAbsolute has now been correct (D153097). I am now mainly concerned with our inaccurate `requiresFixups` and whether there will be users rely on a possibly buggy behavior...
> Did you have suggestion on this, I guess I am not really family enough around that :(
I took quite some time today to investigate it.... See D155357

I think we need a custom fixup to represent the `fixup_riscv_set_uleb128` and `fixup_riscv_sub_uleb128` pair.

In `.handleAddSubRelocations`, split the fixup into 2 relocations.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142879/new/

https://reviews.llvm.org/D142879



More information about the llvm-commits mailing list