[PATCH] Fix weak/linkonce linkage in execution engine

Hi,

I've had problem with a program using LLVM that tried to dynamic_cast
objects created in the JIT execution engine, from the native part of the
program (for the curious, the program is PinaVM
http://gitorious.org/pinavm/pages/Home).

I've narrowed down the issue to the linkage of weak_odr and linkonce_odr
symbols, used for the vtables, and that _must_ be unique for
dynamic_cast to work.

Attached are two patches: the first adds a (failing) testcase, the
second fixes the issue.

I'm not familiar with patch submission on this list, let me know if
there's a better way to submit patches.

0001-add-testcase-for-weak_odr-and-linkonce_odr-in-JIT.patch (2.62 KB)

0002-JIT-fix-linkage-of-weak-and-linkonce-symbols.patch (2.81 KB)

Hi,

I sent this a few days ago, but got no reply, so re-sending to make sure
the patches are not dropped. To summarize, the weak_odr and linkonce_odr
linkage are badly managed in the JIT Execution engine, the patches add
testcases and fix the problem (more details in the commit messages
within the patches).

Regards,

0001-add-testcase-for-weak_odr-and-linkonce_odr-in-JIT.patch (2.62 KB)

0002-JIT-fix-linkage-of-weak-and-linkonce-symbols.patch (2.81 KB)