Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,
Lukas =?utf-8?q?Döllerer?= <[email protected]>,Derek Schuff
 <[email protected]>,Derek Schuff <[email protected]>,Derek Schuff
 <[email protected]>,Derek Schuff <[email protected]>,Derek Schuff
 <[email protected]>,Derek Schuff <[email protected]>,Derek Schuff
 <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


================
@@ -97,6 +102,33 @@ bool WebAssemblyAsmBackend::writeNopData(raw_ostream &OS, 
uint64_t Count,
   return true;
 }
 
+std::optional<bool> WebAssemblyAsmBackend::evaluateFixup(const MCFragment &,
+                                                         MCFixup &Fixup,
+                                                         MCValue &Target,
+                                                         uint64_t &Value) {
+  if (Fixup.getKind() == WebAssembly::fixup_uleb128_i32 &&
+      static_cast<WebAssembly::Specifier>(Target.getSpecifier()) ==
+          WebAssembly::S_None) {
+    if (const auto *SymExpr =
+            dyn_cast_or_null<MCSymbolRefExpr>(Fixup.getValue())) {
+      // only evaluate fixups for temporary symbols
+      // (in-function offsets for compilation hints metadata)
+      if (const MCSymbol &SymA = SymExpr->getSymbol();
----------------
dschuff wrote:

This is indeed a bit of a weird situation; I think some of the weirdness is 
because of the way wasm uses LEB128 pervasively; and usually we want to avoid 
relaxing it but sometimes we want to treat it more "normally" e.g. for use in 
DWARF. Here in this case we want to evaluate it only for this particular use 
case but let it go out to the object as a relocation in other cases. I'm open 
to any actual suggestions to simplify it further.

https://github.com/llvm/llvm-project/pull/146230
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to