Syncs up Makeconfig and the Makelocal.template
[akaros.git] / tools / compilers / gcc-glibc / glibc-2.11.1-ros / sysdeps / ros / rtld.c
1 #define _dl_start _dl_start_real
2 #include <elf/rtld.c>
3 #undef _dl_start
4
5 #include <ros/syscall.h>
6 #include <ros/procinfo.h>
7
8 static ElfW(Addr) __attribute_used__ internal_function
9 _dl_start(void* arg0)
10 {
11         int argc = 0;
12         while(__procinfo.argp[argc])
13                 argc++;
14
15         char** arg = (char**)alloca((PROCINFO_MAX_ARGP+1)*sizeof(char*));
16         arg[0] = (char*)argc;
17         memcpy(arg+1,__procinfo.argp,PROCINFO_MAX_ARGP*sizeof(char*));
18
19         return _dl_start_real(arg);
20 }