Lukasdoe wrote:

I just figured out a problem with the current implementation: When wasm-ld 
eliminates functions, their relocations are just written to the tombstone 
value, which is 0. This is not conformant to the spec, because it both leads to 
branch hints for the wrong function (typically funcidx will be an imported 
function, at least for wasi) and it generates duplicate branch hints for the 
same function idx (0).

I currently see two options:
- Add a sentinel value for an invalid branch hint to the spec (hacky, but keeps 
us from having to parse branch hints in lld)
- Parse branch hints in lld and make sure that no branch hints for omitted 
functions are included in the final binary (cleaner change, but significantly 
more code changes)

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

Reply via email to