LEFT | RIGHT |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #include "runtime.h" | 5 #include "runtime.h" |
6 #include "defs_GOOS_GOARCH.h" | 6 #include "defs_GOOS_GOARCH.h" |
7 #include "signals_GOOS.h" | 7 #include "signals_GOOS.h" |
8 #include "os_GOOS.h" | 8 #include "os_GOOS.h" |
9 | 9 |
10 void | 10 void |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 runtime·throw("rt_sigaction failure"); | 149 runtime·throw("rt_sigaction failure"); |
150 } | 150 } |
151 | 151 |
152 #define AT_NULL 0 | 152 #define AT_NULL 0 |
153 #define AT_RANDOM 25 | 153 #define AT_RANDOM 25 |
154 #define AT_SYSINFO 32 | 154 #define AT_SYSINFO 32 |
155 extern uint32 runtime·_vdso; | 155 extern uint32 runtime·_vdso; |
156 | 156 |
157 #pragma textflag 7 | 157 #pragma textflag 7 |
158 void | 158 void |
159 runtime·linux_setup_vdso(int32 argc, void *argv_list) | 159 runtime·linux_setup_vdso(int32 argc, byte **argv) |
160 { | 160 { |
161 byte **argv = &argv_list; | |
162 byte **envp; | 161 byte **envp; |
163 uint32 *auxv; | 162 uint32 *auxv; |
164 | 163 |
165 // skip envp to get to ELF auxiliary vector. | 164 // skip envp to get to ELF auxiliary vector. |
166 for(envp = &argv[argc+1]; *envp != nil; envp++) | 165 for(envp = &argv[argc+1]; *envp != nil; envp++) |
167 ; | 166 ; |
168 envp++; | 167 envp++; |
169 ········ | 168 ········ |
170 for(auxv=(uint32*)envp; auxv[0] != AT_NULL; auxv += 2) { | 169 for(auxv=(uint32*)envp; auxv[0] != AT_NULL; auxv += 2) { |
171 if(auxv[0] == AT_SYSINFO) { | 170 if(auxv[0] == AT_SYSINFO) { |
172 runtime·_vdso = auxv[1]; | 171 runtime·_vdso = auxv[1]; |
173 continue; | 172 continue; |
174 } | 173 } |
175 » » if (auxv[0] == AT_RANDOM) { | 174 » » if(auxv[0] == AT_RANDOM) { |
176 » » » runtime·at_random_data = (byte*)auxv[1]; | 175 » » » runtime·startup_random_data = (byte*)auxv[1]; |
| 176 » » » runtime·startup_random_data_len = 16; |
177 continue; | 177 continue; |
178 } | 178 } |
179 } | 179 } |
180 } | 180 } |
LEFT | RIGHT |