diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 4fffb516ddd..43c8b6bf1eb 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -d5e4595784fb744f5fa0e0f90e77de9b5448b793 +805c82cc141c593ea2f27d8614ecd204e2b5e76e The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/runtime/os3_solaris.go b/libgo/go/runtime/os3_solaris.go index c19f797f5e0..e67d32c8054 100644 --- a/libgo/go/runtime/os3_solaris.go +++ b/libgo/go/runtime/os3_solaris.go @@ -4,45 +4,19 @@ package runtime -import ( - "runtime/internal/sys" - "unsafe" -) +import _ "unsafe" var executablePath string +//extern getexecname +func getexecname() *byte + +//extern getpagesize +func getpagesize() int32 + func sysargs(argc int32, argv **byte) { - n := argc + 1 - - // skip over argv, envp to get to auxv - for argv_index(argv, n) != nil { - n++ - } - - // skip NULL separator - n++ - - // now argv+n is auxv - auxv := (*[1 << 28]uintptr)(add(unsafe.Pointer(argv), uintptr(n)*sys.PtrSize)) - sysauxv(auxv[:]) -} - -const ( - _AT_NULL = 0 // Terminates the vector - _AT_PAGESZ = 6 // Page size in bytes - _AT_SUN_EXECNAME = 2014 // exec() path name -) - -func sysauxv(auxv []uintptr) { - for i := 0; auxv[i] != _AT_NULL; i += 2 { - tag, val := auxv[i], auxv[i+1] - switch tag { - case _AT_PAGESZ: - physPageSize = val - case _AT_SUN_EXECNAME: - executablePath = gostringnocopy((*byte)(unsafe.Pointer(val))) - } - } + physPageSize = uintptr(getpagesize()) + executablePath = gostringnocopy(getexecname()) } //go:linkname solarisExecutablePath os.solarisExecutablePath