process.cc (10905:a6ca6831e775) | process.cc (11320:42ecb523c64a) |
---|---|
1/* 2 * Copyright (c) 2003-2004 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; --- 61 unchanged lines hidden (view full) --- 70 objFile->loadSections(initVirtMem); 71 72 typedef AuxVector<uint64_t> auxv_t; 73 std::vector<auxv_t> auxv; 74 75 ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile); 76 if(elfObject) 77 { | 1/* 2 * Copyright (c) 2003-2004 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; --- 61 unchanged lines hidden (view full) --- 70 objFile->loadSections(initVirtMem); 71 72 typedef AuxVector<uint64_t> auxv_t; 73 std::vector<auxv_t> auxv; 74 75 ElfObject * elfObject = dynamic_cast<ElfObject *>(objFile); 76 if(elfObject) 77 { |
78 // modern glibc uses a bunch of auxiliary vectors to set up | 78 // modern glibc uses a bunch of auxiliary vectors to set up |
79 // TLS as well as do a bunch of other stuff 80 // these vectors go on the bottom of the stack, below argc/argv/envp 81 // pointers but above actual arg strings 82 // I don't have all the ones glibc looks at here, but so far it doesn't 83 // seem to be a problem. 84 // check out _dl_aux_init() in glibc/elf/dl-support.c for details 85 // --Lisa 86 auxv.push_back(auxv_t(M5_AT_PAGESZ, AlphaISA::PageBytes)); --- 19 unchanged lines hidden (view full) --- 106 arg_data_size += argv[i].size() + 1; 107 } 108 int env_data_size = 0; 109 for (vector<string>::size_type i = 0; i < envp.size(); ++i) { 110 env_data_size += envp[i].size() + 1; 111 } 112 113 int space_needed = | 79 // TLS as well as do a bunch of other stuff 80 // these vectors go on the bottom of the stack, below argc/argv/envp 81 // pointers but above actual arg strings 82 // I don't have all the ones glibc looks at here, but so far it doesn't 83 // seem to be a problem. 84 // check out _dl_aux_init() in glibc/elf/dl-support.c for details 85 // --Lisa 86 auxv.push_back(auxv_t(M5_AT_PAGESZ, AlphaISA::PageBytes)); --- 19 unchanged lines hidden (view full) --- 106 arg_data_size += argv[i].size() + 1; 107 } 108 int env_data_size = 0; 109 for (vector<string>::size_type i = 0; i < envp.size(); ++i) { 110 env_data_size += envp[i].size() + 1; 111 } 112 113 int space_needed = |
114 argv_array_size + 115 envp_array_size + | 114 argv_array_size + 115 envp_array_size + |
116 auxv_array_size + | 116 auxv_array_size + |
117 arg_data_size + | 117 arg_data_size + |
118 env_data_size; 119 120 if (space_needed < 32*1024) 121 space_needed = 32*1024; 122 123 // set bottom of stack 124 stack_min = stack_base - space_needed; 125 // align it --- 112 unchanged lines hidden --- | 118 env_data_size; 119 120 if (space_needed < 32*1024) 121 space_needed = 32*1024; 122 123 // set bottom of stack 124 stack_min = stack_base - space_needed; 125 // align it --- 112 unchanged lines hidden --- |