gcc/libgo/go/runtime
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
..
debug compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
internal compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
msan libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
pprof compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
testdata libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
trace libgo: update to Go 1.11.1 release 2018-10-08 14:21:30 +00:00
alg.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
atomic_pointer.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
auxv_none.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
callers_test.go
cgo_gccgo.go runtime: remove the dummy arg of getcallersp 2018-08-24 18:15:04 +00:00
cgocall.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
cgocheck.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
chan.go libgo: update to Go 1.11.1 release 2018-10-08 14:21:30 +00:00
chan_test.go
chanbarrier_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
closure_test.go
compiler.go
complex_test.go
cpuprof.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
cputicks.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
crash_cgo_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
crash_gccgo_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
crash_nonunix_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
crash_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
crash_unix_test.go
debug.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
debug_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
env_posix.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
env_test.go
error.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
example_test.go
export_arm_test.go
export_debug_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
export_linux_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
export_mmap_test.go
export_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
export_unix_test.go
export_windows_test.go
extern.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
fastlog2.go
fastlog2_test.go
fastlog2table.go
ffi.go runtime: skip zero-sized fields in structs when converting to FFI 2018-07-13 20:39:02 +00:00
float.go
gc_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
gcinfo_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
hash32.go libgo: add support for the Nios II architecture 2018-05-02 22:28:46 +00:00
hash64.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
hash_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
heapdump.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
iface.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
iface_test.go
lfstack.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
lfstack_32bit.go libgo: support x32 as GOARCH=amd64p32 GOOS=linux 2018-10-01 20:17:11 +00:00
lfstack_64bit.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
lfstack_test.go
lock_futex.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
lock_js.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
lock_sema.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
malloc.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
malloc_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
map.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
map_benchmark_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
map_fast32.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
map_fast64.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
map_faststr.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
map_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
mbarrier.go libgo: update to Go 1.11.1 release 2018-10-08 14:21:30 +00:00
mbitmap.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
mcache.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
mcentral.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
mem_gccgo.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
memmove_linux_amd64_test.go
memmove_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
mfinal.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
mfinal_test.go
mfixalloc.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
mgc.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
mgc_gccgo.go compiler, runtime: call gcWriteBarrier instead of writebarrierptr 2018-09-13 22:25:58 +00:00
mgclarge.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
mgcmark.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
mgcsweep.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
mgcsweepbuf.go
mgcwork.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
mheap.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
mkfastlog2table.go
mksizeclasses.go
mprof.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
msan0.go
msize.go
mstats.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
mwbbuf.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
net_plan9.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
netpoll.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
netpoll_aix.go runtime: use poll rather than pollset for netpoll on AIX 2018-08-07 17:29:50 +00:00
netpoll_epoll.go
netpoll_fake.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
netpoll_kqueue.go
netpoll_solaris.go
netpoll_stub.go
netpoll_windows.go
norace_test.go runtime: remove the dummy arg of getcallersp 2018-08-24 18:15:04 +00:00
numcpu_freebsd_test.go
os3_solaris.go runtime, os: fix the build on Solaris 2018-09-26 03:29:07 +00:00
os_aix.go
os_darwin.go libgo: update to Go 1.11.1 release 2018-10-08 14:21:30 +00:00
os_dragonfly.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
os_freebsd.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
os_gccgo.go
os_js.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
os_linux.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
os_linux_arm.go re PR go/87661 (libgo bootstrap failure on arm-linux-gnueabihf (redefinition of constants)) 2018-10-23 19:02:29 +00:00
os_linux_arm64.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
os_linux_mips64x.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
os_linux_mipsx.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
os_linux_noauxv.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
os_linux_ppc64x.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
os_linux_s390x.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
os_netbsd.go libgo: update to Go 1.11.1 release 2018-10-08 14:21:30 +00:00
os_openbsd.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
os_solaris.go
panic.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
print.go
proc.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
proc_runtime_test.go
proc_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
profbuf.go
profbuf_test.go
proflabel.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
race0.go
rand_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
rdebug.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
relax_stub.go
runtime-lldb_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
runtime.go
runtime1.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
runtime2.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
runtime_mmap_test.go
runtime_test.go runtime: skip testSetPanicOnFault for gollvm 2018-10-09 16:51:10 +00:00
runtime_unix_test.go
rwmutex.go
rwmutex_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
select.go libgo: update to Go 1.11.1 release 2018-10-08 14:21:30 +00:00
sema.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
signal_gccgo.go
signal_sighandler.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
signal_unix.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
sigqueue.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
sizeclasses.go
sizeof_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
slice.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
slice_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
string.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
string_test.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
stubs.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
stubs2.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
stubs3.go runtime, os: fix the build on Solaris 2018-09-26 03:29:07 +00:00
stubs_linux.go
stubs_nonlinux.go
symtab.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
symtab_test.go
sys_darwin.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
sys_wasm.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
time.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
timeasm.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
timestub.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
timestub2.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
trace.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
traceback_gccgo.go compiler: improve name mangling for packpaths 2018-10-25 22:18:08 +00:00
type.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
typekind.go
unaligned1.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
unaligned2.go libgo: add support for the Nios II architecture 2018-05-02 22:28:46 +00:00
utf8.go libgo: update to Go 1.11 2018-09-24 21:46:21 +00:00
write_err.go
write_err_android.go