runtime: fix isSystemGoroutine for gccgo

The gc toolchain decides whether a goroutine is a system goroutine by
comparing startpc to a list of saved special PCs.  In gccgo that
approach does not work as startpc is often a thunk that invokes the
real function with arguments, so the thunk address never matches the
saved special PCs.

This patch fixes gccgo's understanding of system goroutines.  Since
there are only a limited number of them, we simply change each one to
mark itself as special.

This fixes stack dumps and functions like runtime.NumGoroutine to
behave more like gc.  It also fixes the goprint test in the gc
testsuite.

Change-Id: I17577250d26f955406d13a12b24c8604621e5c53
Reviewed-on: https://go-review.googlesource.com/43156
Reviewed-by: Than McIntosh <thanm@google.com>
7 files changed