When D42105 was landed, a chunk from it was discarded.
This review re-commits that specific chunk, plus a test that exercises it.
Changes:
- When using --emit-relocs or --relocatable, we really do need to import undefined weak symbols, since relocations are generated against them.
- The relocatable.ll test has been updated with an import of a weak undefined symbol to illustrate the issue.
It's not possible to commit the test separately from the fix - without the fix, the test crashes!