compiler: mangle dots in pkgpath

We need to mangle dots to avoid problems with -fgo-pkgpath=a.0.
That will confuse the name mangling, which assumes that names
entering the mangling cannot contain arbitrary dot characters.
We don't need to mangle other characters; go_encode_id will handle them.

Fixes golang/go#33871

Change-Id: Id1810f56fd39b5573621287056afff22be9e54e2
Reviewed-by: Than McIntosh <>
3 files changed