process.cc (4829:181a056d7dc4) process.cc (4847:41126ac89de7)
1/*
2 * Copyright (c) 2003-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 276 unchanged lines hidden (view full) ---

285
286 //Figure out how big the initial stack needs to be
287
288 // The unaccounted for 0 at the top of the stack
289 int mysterious_size = intSize;
290
291 //This is the name of the file which is present on the initial stack
292 //It's purpose is to let the user space linker examine the original file.
1/*
2 * Copyright (c) 2003-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 276 unchanged lines hidden (view full) ---

285
286 //Figure out how big the initial stack needs to be
287
288 // The unaccounted for 0 at the top of the stack
289 int mysterious_size = intSize;
290
291 //This is the name of the file which is present on the initial stack
292 //It's purpose is to let the user space linker examine the original file.
293 int file_name_size = filename.size();
293 int file_name_size = filename.size() + 1;
294
295 string platform = "x86_64";
296 int aux_data_size = platform.size() + 1;
297
298 int env_data_size = 0;
299 for (int i = 0; i < envp.size(); ++i) {
294
295 string platform = "x86_64";
296 int aux_data_size = platform.size() + 1;
297
298 int env_data_size = 0;
299 for (int i = 0; i < envp.size(); ++i) {
300 env_data_size += envp[i].size();
300 env_data_size += envp[i].size() + 1;
301 }
302 int arg_data_size = 0;
303 for (int i = 0; i < argv.size(); ++i) {
301 }
302 int arg_data_size = 0;
303 for (int i = 0; i < argv.size(); ++i) {
304 arg_data_size += argv[i].size();
304 warn("Argv[%d] size is %d\n", i, argv[i].size() + 1);
305 arg_data_size += argv[i].size() + 1;
305 }
306
307 //The auxiliary vector data needs to be padded so it's size is a multiple
308 //of the alignment mask.
309 int aux_padding =
310 ((aux_data_size + ~alignmentMask) & alignmentMask) - aux_data_size;
311
312 //The info_block needs to be padded so it's size is a multiple of the

--- 114 unchanged lines hidden ---
306 }
307
308 //The auxiliary vector data needs to be padded so it's size is a multiple
309 //of the alignment mask.
310 int aux_padding =
311 ((aux_data_size + ~alignmentMask) & alignmentMask) - aux_data_size;
312
313 //The info_block needs to be padded so it's size is a multiple of the

--- 114 unchanged lines hidden ---