Revision 125b0f55
b/linux-user/elfload.c | ||
---|---|---|
1245 | 1245 |
struct image_info *interp_info) |
1246 | 1246 |
{ |
1247 | 1247 |
abi_ulong sp; |
1248 |
abi_ulong sp_auxv; |
|
1248 | 1249 |
int size; |
1249 | 1250 |
int i; |
1250 | 1251 |
abi_ulong u_rand_bytes; |
... | ... | |
1316 | 1317 |
sp -= n; put_user_ual(id, sp); \ |
1317 | 1318 |
} while(0) |
1318 | 1319 |
|
1320 |
sp_auxv = sp; |
|
1319 | 1321 |
NEW_AUX_ENT (AT_NULL, 0); |
1320 | 1322 |
|
1321 | 1323 |
/* There must be exactly DLINFO_ITEMS entries here. */ |
... | ... | |
1346 | 1348 |
#undef NEW_AUX_ENT |
1347 | 1349 |
|
1348 | 1350 |
info->saved_auxv = sp; |
1351 |
info->auxv_len = sp_auxv - sp; |
|
1349 | 1352 |
|
1350 | 1353 |
sp = loader_build_argptr(envc, argc, sp, p, 0); |
1351 | 1354 |
return sp; |
... | ... | |
2326 | 2329 |
{ |
2327 | 2330 |
elf_addr_t auxv = (elf_addr_t)ts->info->saved_auxv; |
2328 | 2331 |
elf_addr_t orig_auxv = auxv; |
2329 |
abi_ulong val; |
|
2330 | 2332 |
void *ptr; |
2331 |
int i, len;
|
|
2333 |
int len = ts->info->auxv_len;
|
|
2332 | 2334 |
|
2333 | 2335 |
/* |
2334 | 2336 |
* Auxiliary vector is stored in target process stack. It contains |
... | ... | |
2336 | 2338 |
* strictly necessary but we do it here for sake of completeness. |
2337 | 2339 |
*/ |
2338 | 2340 |
|
2339 |
/* find out length of the vector, AT_NULL is terminator */ |
|
2340 |
i = len = 0; |
|
2341 |
do { |
|
2342 |
get_user_ual(val, auxv); |
|
2343 |
i += 2; |
|
2344 |
auxv += 2 * sizeof (elf_addr_t); |
|
2345 |
} while (val != AT_NULL); |
|
2346 |
len = i * sizeof (elf_addr_t); |
|
2347 |
|
|
2348 | 2341 |
/* read in whole auxv vector and copy it to memelfnote */ |
2349 | 2342 |
ptr = lock_user(VERIFY_READ, orig_auxv, len, 0); |
2350 | 2343 |
if (ptr != NULL) { |
b/linux-user/qemu.h | ||
---|---|---|
48 | 48 |
abi_ulong code_offset; |
49 | 49 |
abi_ulong data_offset; |
50 | 50 |
abi_ulong saved_auxv; |
51 |
abi_ulong auxv_len; |
|
51 | 52 |
abi_ulong arg_start; |
52 | 53 |
abi_ulong arg_end; |
53 | 54 |
int personality; |
Also available in: Unified diff