Clean up the argc/argv/envp/auxv handling.
There's now only one place where we deal with this stuff, it only needs to be parsed once by the dynamic linker (rather than by each recipient), and it's now easier for us to get hold of auxv data early on. Change-Id: I6314224257c736547aac2e2a650e66f2ea53bef5
This commit is contained in:
@@ -32,17 +32,13 @@
|
||||
#include <private/bionic_auxv.h>
|
||||
#include <elf.h>
|
||||
|
||||
__LIBC_HIDDEN__
|
||||
Elf32_auxv_t* __libc_auxv = NULL;
|
||||
__LIBC_HIDDEN__ Elf32_auxv_t* __libc_auxv = NULL;
|
||||
|
||||
extern "C" unsigned long int getauxval(unsigned long int type) {
|
||||
Elf32_auxv_t* v;
|
||||
|
||||
for (v = __libc_auxv; v->a_type != AT_NULL; v++) {
|
||||
for (Elf32_auxv_t* v = __libc_auxv; v->a_type != AT_NULL; ++v) {
|
||||
if (v->a_type == type) {
|
||||
return v->a_un.a_val;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user