Resolve globals having different addresses across crates

* All globals marked as `pub` won't have the `internal` linkage type set
* All global references across crates are forced to use the address of the
  global in the other crate via an external reference.
auto merge of #8185 : alexcrichton/rust/issue-8179, r=pcwalton

* All globals marked as `pub` won't have the `internal` linkage type set
* All global references across crates are forced to use the address of the
  global in the other crate via an external reference.

r? @graydon

Closes #8179