diff options
Diffstat (limited to 'src/runtime/os_linux_arm64.go')
| -rw-r--r-- | src/runtime/os_linux_arm64.go | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/runtime/os_linux_arm64.go b/src/runtime/os_linux_arm64.go index 3f994f128b..43262aea14 100644 --- a/src/runtime/os_linux_arm64.go +++ b/src/runtime/os_linux_arm64.go @@ -4,13 +4,19 @@ package runtime -const ( - _AT_NULL = 0 - _AT_RANDOM = 25 // introduced in 2.6.29 -) - var randomNumber uint32 +func archauxv(tag, val uintptr) { + switch tag { + case _AT_RANDOM: + // sysargs filled in startupRandomData, but that + // pointer may not be word aligned, so we must treat + // it as a byte array. + randomNumber = uint32(startupRandomData[4]) | uint32(startupRandomData[5])<<8 | + uint32(startupRandomData[6])<<16 | uint32(startupRandomData[7])<<24 + } +} + //go:nosplit func cputicks() int64 { // Currently cputicks() is used in blocking profiler and to seed fastrand1(). |
