Changeset 317 in dev for trunk/abdev/BasicCompiler64/MakePeHdr.cpp
- Timestamp:
- Sep 8, 2007, 8:43:18 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/MakePeHdr.cpp
r315 r317 789 789 //グローバル変数情報を扱う構造体も初期バッファの有無による配置を行う 790 790 //(デバッグ情報で利用される) 791 extern int AllInitGlobalVarSize;792 791 BOOST_FOREACH( Variable *pVar, compiler.GetObjectModule().meta.GetGlobalVars() ){ 793 792 if(pVar->GetOffsetAddress()&0x80000000){ 794 793 pVar->SetOffsetAddress( 795 (pVar->GetOffsetAddress()&0x7FFFFFFF)+AllInitGlobalVarSize 794 (pVar->GetOffsetAddress()&0x7FFFFFFF) 795 + compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.GetSize() 796 796 ); 797 797 } … … 863 863 864 864 //リライタブルセクションのファイル上のサイズ(グローバル変数の初期情報のみを格納) 865 extern int AllInitGlobalVarSize; 866 if(AllInitGlobalVarSize%FILE_ALIGNMENT) FileSize_RWSection=AllInitGlobalVarSize+(FILE_ALIGNMENT-AllInitGlobalVarSize%FILE_ALIGNMENT); 865 if( compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.GetSize() % FILE_ALIGNMENT ) 866 { 867 FileSize_RWSection = 868 compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.GetSize() 869 + (FILE_ALIGNMENT-compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.GetSize()%FILE_ALIGNMENT); 870 } 867 871 else{ 868 if(AllInitGlobalVarSize) FileSize_RWSection=AllInitGlobalVarSize; 872 if( compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.GetSize() ) 873 { 874 FileSize_RWSection = compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.GetSize(); 875 } 869 876 else FileSize_RWSection=FILE_ALIGNMENT; 870 877 } … … 927 934 928 935 //リライタブルセクションのメモリ上のサイズ 929 extern int AllGlobalVarSize;930 i=AllInitGlobalVarSize+AllGlobalVarSize;936 i = compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.GetSize() 937 + compiler.GetObjectModule().meta.GetGlobalVars().GetAllSize(); 931 938 if(i%MEM_ALIGNMENT) MemSize_RWSection=i+(MEM_ALIGNMENT-i%MEM_ALIGNMENT); 932 939 else MemSize_RWSection=i; … … 1312 1319 memset((char *)RWSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME); 1313 1320 lstrcpy((char *)RWSectionHeader.Name,".data"); 1314 RWSectionHeader.Misc.VirtualSize= AllInitGlobalVarSize+AllGlobalVarSize; 1321 RWSectionHeader.Misc.VirtualSize= compiler.GetObjectModule().meta.GetGlobalVars().initAreaBuffer.GetSize() 1322 + compiler.GetObjectModule().meta.GetGlobalVars().GetAllSize(); 1315 1323 RWSectionHeader.VirtualAddress= MemPos_RWSection; 1316 1324 RWSectionHeader.SizeOfRawData= FileSize_RWSection;
Note:
See TracChangeset
for help on using the changeset viewer.