If merging them, the dllexport attribute needs to be brought along to the new GlobalAlias.
This is a follow-up to D42127 (which just turned off merging of dllexported variables). Handling it properly turned out to be very straightforward after all. I hadn't noticed before that GlobalAlias handily was a GlobalValue subclass - otherwise this would have end up as a much larger change.