cmd/go, cmd/cgo: update gofrontend mangling checks

This is a port of two patches in the master repository.

    cmd/cgo: split gofrontend mangling checks into cmd/internal/pkgpath

    This is a step toward porting from the
    gofrontend repo to the main repo.

    Note that this also corrects the implementation of the v2 mangling
    scheme to use ..u and ..U where appropriate.

    cmd/go: use cmd/internal/pkgpath for gccgo pkgpath symbol

For golang/go#37272
For golang/go#41862

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