diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-09-13 12:00:31 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-09-13 12:00:31 +0200 |
| commit | 04f99b387021a8ce32a8795360cba9beaf986a81 (patch) | |
| tree | f806c632c5dec5bb83190946d6d8ff8bd33c0e57 /src/pkg/runtime/linux/386/signal.c | |
| parent | d9514677ddaa705852cbba5034cb6d284261b53a (diff) | |
| download | golang-04f99b387021a8ce32a8795360cba9beaf986a81.tar.gz | |
Imported Upstream version 2011.09.07upstream-weekly/2011.09.07
Diffstat (limited to 'src/pkg/runtime/linux/386/signal.c')
| -rw-r--r-- | src/pkg/runtime/linux/386/signal.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/pkg/runtime/linux/386/signal.c b/src/pkg/runtime/linux/386/signal.c index 8916e10bd..4045b2efc 100644 --- a/src/pkg/runtime/linux/386/signal.c +++ b/src/pkg/runtime/linux/386/signal.c @@ -182,3 +182,27 @@ os·sigpipe(void) sigaction(SIGPIPE, SIG_DFL, false); runtime·raisesigpipe(); } + +#define AT_NULL 0 +#define AT_SYSINFO 32 +extern uint32 runtime·_vdso; + +#pragma textflag 7 +void runtime·linux_setup_vdso(int32 argc, void *argv_list) +{ + byte **argv = &argv_list; + byte **envp; + uint32 *auxv; + + // skip envp to get to ELF auxiliary vector. + for(envp = &argv[argc+1]; *envp != nil; envp++) + ; + envp++; + + for(auxv=(uint32*)envp; auxv[0] != AT_NULL; auxv += 2) { + if(auxv[0] == AT_SYSINFO) { + runtime·_vdso = auxv[1]; + break; + } + } +} |
