gcc/libgo/go/internal
Ian Lance Taylor 34489eb2af compiler: improve name mangling for packpaths
The current implementation of Gogo::pkgpath_for_symbol was written in
    a way that allowed two distinct package paths to map to the same
    symbol, which could cause collisions at link- time or compile-time.
    
    Switch to a better mangling scheme to insure that we get a unique
    packagepath symbol for each package. In the new scheme instead of having
    separate mangling schemes for identifiers and package paths, the
    main identifier mangler ("go_encode_id") now handles mangling of
    both packagepath characters and identifier characters.
    
    The new mangling scheme is more intrusive: "foo/bar.Baz" is mangled as
    "foo..z2fbar.Baz" instead of "foo_bar.Baz". To mitigate this, this
    patch also adds a demangling capability so that function names
    returned from runtime.CallersFrames are converted back to their
    original unmangled form.
    
    Changing the pkgpath_for_symbol scheme requires updating a number of
    //go:linkname directives and C "__asm__" directives to match the new
    scheme, as well as updating the 'gotest' driver (which makes
    assumptions about the correct mapping from pkgpath symbol to package
    name).
    
    Fixes golang/go#27534.
    
    Reviewed-on: https://go-review.googlesource.com/c/135455

From-SVN: r265510
2018-10-25 22:18:08 +00:00
..
bytealg compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
cpu compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
goroot libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
nettrace
poll internal/bytealg, internal/cpu, internal/poll: portability fixes 2018-09-25 14:31:57 +00:00
race
singleflight libgo: update to Go 1.10.2 release 2018-05-31 21:42:53 +00:00
syscall libgo: support x32 as GOARCH=amd64p32 GOOS=linux 2018-10-01 20:17:11 +00:00
testenv libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
testlog libgo: update to Go1.10beta2 release 2018-01-17 14:20:29 +00:00
trace libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00