Handle common linkage correctly in the gold plugin.

This is the plugin version of pr20882.

This handles the case of every common symbol being in the IR. We will need some
support from gold to handle the case where some symbols are in ELF and some in
the IR.