[PATCH] D18683: Fix bug with duplicate struct types in Linker

Tim Armstrong via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 16:36:07 PDT 2016


timarmstrong added a comment.

Typeless pointers definitely solve the problem and I'm sure this code will all go away once that happens, but in the meantime a lot of LLVM does care a lot about the exact pointee type.

We could keep track of where each function came from, and if we generate a call to a linked function, grovel around in the linked function signatures, work out what type the linker decided to assign it and then generate a bunch of bitcasts (since the pointer might be the original type if it came from the source module), but I'd rather not resort to doing that.  It seems easier to fix the problem at the source (and also solve it for anyone else who's building jits using LLVM in a similar way).

I have no idea what the intended behaviour of the Linker is since there's not much documentation about what the linker is/isn't allow to do, but this is something that has worked historically. It wouldn't expect it to work if the struct types had different names originally, but this is just reversing some renaming that LLVM did.


http://reviews.llvm.org/D18683





More information about the llvm-commits mailing list