]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: move startupRandomData declaration to os_linux.go
authorTobias Klauser <tklauser@distanz.ch>
Mon, 17 Aug 2020 14:32:33 +0000 (16:32 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Tue, 18 Aug 2020 08:47:48 +0000 (08:47 +0000)
startupRandomData is only used in sysauxv and getRandomData on linux,
thus move it closer to where it is used. Also adjust its godoc comment.

Change-Id: Ice51d579ec33436adbfdf247caf4ba00bae865e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/248761
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/os_linux.go
src/runtime/runtime2.go

index 22931b4d5cba22b5e83f5c85a3fed22af02cde5e..9702920bcffd446db0507ef6b7125ef337e391d4 100644 (file)
@@ -249,6 +249,10 @@ func sysargs(argc int32, argv **byte) {
        sysauxv(buf[:])
 }
 
+// startupRandomData holds random bytes initialized at startup. These come from
+// the ELF AT_RANDOM auxiliary vector.
+var startupRandomData []byte
+
 func sysauxv(auxv []uintptr) int {
        var i int
        for ; auxv[i] != _AT_NULL; i += 2 {
index 0bddcaa789b168d5ebb60f53f0325d73dc2a1bc3..959878400dda3ba3831e0475af279f6b180e1aac 100644 (file)
@@ -845,10 +845,6 @@ type forcegcstate struct {
        idle uint32
 }
 
-// startup_random_data holds random bytes initialized at startup. These come from
-// the ELF AT_RANDOM auxiliary vector (vdso_linux_amd64.go or os_linux_386.go).
-var startupRandomData []byte
-
 // extendRandom extends the random numbers in r[:n] to the whole slice r.
 // Treats n<0 as n==0.
 func extendRandom(r []byte, n int) {