[Core] Allow weak symbols in shared library when linking.

Patch by Rui Ueyama.