Author: tkreuzer Date: Mon Jan 26 16:48:54 2009 New Revision: 39121
URL: http://svn.reactos.org/svn/reactos?rev=39121&view=rev Log: rsym64: instead of stripping sections from the middle of the PE, convert them to bss sections to make windows happy and keep the files small. Thanks to kjk for finding the problem.
Modified: branches/ros-amd64-bringup/reactos/tools/rsym/rsym64.c
Modified: branches/ros-amd64-bringup/reactos/tools/rsym/rsym64.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/tools/... ============================================================================== --- branches/ros-amd64-bringup/reactos/tools/rsym/rsym64.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/tools/rsym/rsym64.c [iso-8859-1] Mon Jan 26 16:48:54 2009 @@ -802,8 +802,7 @@ pName = File->Strings + index;
// Hack, simply remove all sections with long names - if (strcmp(pName, ".eh_frame") != 0) - File->UseSection[i] = 0; + File->UseSection[i] = 0; }
/* Chek if we have the eh_frame section */ @@ -816,7 +815,7 @@
/* Increase number of used sections */ if (File->UseSection[i]) - File->UsedSections++; + File->UsedSections = i+1;
}
@@ -829,19 +828,25 @@ CurrentPos = ROUND_UP(CurrentPos, Alignment);
/* Create new section headers */ - for (i = 0, j = 0; i < File->AllSections; i++) - { - if (File->UseSection[i]) - { - /* Copy section header */ - File->NewSectionHeaders[j] = - File->SectionHeaders[i]; - /* Fix Offset into File */ - File->NewSectionHeaders[j].PointerToRawData = - File->SectionHeaders[i].PointerToRawData ? CurrentPos : 0; - CurrentPos += File->NewSectionHeaders[j].SizeOfRawData; - j++; - } + for (i = 0, j = 0; i < File->UsedSections; i++) + { + /* Copy section header */ + File->NewSectionHeaders[j] = File->SectionHeaders[i]; + + /* Shall we strip the section? */ + if (File->UseSection[i] == 0) + { + /* Make it a bss section */ + File->NewSectionHeaders[j].PointerToRawData = 0; + File->NewSectionHeaders[j].SizeOfRawData = 0; + File->NewSectionHeaders[j].Characteristics = 0xC0500080; + } + + /* Fix Offset into File */ + File->NewSectionHeaders[j].PointerToRawData = + File->NewSectionHeaders[j].PointerToRawData ? CurrentPos : 0; + CurrentPos += File->NewSectionHeaders[j].SizeOfRawData; + j++; }
if (File->eh_frame.idx == -1)