compiler, libgo: change mangling scheme

Overhaul the mangling scheme to avoid ambiguities if the package path
contains a dot. Instead of using dot both to separate components and
to mangle characters, use dot only to separate components and use
underscore to mangle characters.

For golang/go#41862

Change-Id: Iddc04422673a4cdc6773d24d3d75fc8945266773
Trust: Ian Lance Taylor <>
Reviewed-by: Than McIntosh <>
56 files changed