[PATCH] D44349: [WebAssembly] Verify contents of relocations target before writing it

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 14 14:38:32 PDT 2018


sbc100 added a subscriber: mcgrathr.
sbc100 added a comment.

In https://reviews.llvm.org/D44349#1037809, @ruiu wrote:

> I doubt that you really need to do that for every invocation of the linker. Generally speaking, relocation handling is what you want to optimize the most because the number of relocation can be really huge (it can be tens of millions). In addition to that, there are a lot of different ways that a compiler can be wrong, and catching only one error in the linker doesn't make much sense to me. Why is finding this particular error so important? We generally trust compilers that they create sane object files. To be honest, I think we should remove this check completely.


I'd be OK with doing this is debug builds only perhaps.

The motivating reason is that we are thinking of adding linker relaxation for accessing external global addresses.  I was speaking to @mcgrathr about this and he said that the linker (in this case at least) can/should/does check for sanity of the surrounding instructions before replacing/modifying it.   So I'd also be OK only doing this when we do relaxation perhaps?


Repository:
  rL LLVM

https://reviews.llvm.org/D44349





More information about the llvm-commits mailing list