Author: tkreuzer
Date: Sun Jun 19 11:53:10 2011
New Revision: 52363
URL:
http://svn.reactos.org/svn/reactos?rev=52363&view=rev
Log:
[OBJ2BIN]
Fix handling of empty sections
Modified:
trunk/reactos/tools/obj2bin/obj2bin.c
Modified: trunk/reactos/tools/obj2bin/obj2bin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/obj2bin/obj2bin.c?re…
==============================================================================
--- trunk/reactos/tools/obj2bin/obj2bin.c [iso-8859-1] (original)
+++ trunk/reactos/tools/obj2bin/obj2bin.c [iso-8859-1] Sun Jun 19 11:53:10 2011
@@ -63,14 +63,12 @@
{
char *pszSourceFile;
char *pszDestFile;
- unsigned long nFileSize, nBaseAddress, nOffsetSectionHeaders;
+ unsigned long nFileSize, nBaseAddress;
FILE *pSourceFile, *pDestFile;
IMAGE_FILE_HEADER *pFileHeader;
IMAGE_SECTION_HEADER *pSectionHeader;
unsigned int i;
- size_t nSize;
char *pData;
- PIMAGE_RELOCATION pReloc;
PIMAGE_SYMBOL pSymbols;
if ((argc != 4) || (strcmp(argv[1], "--help") == 0))
@@ -129,11 +127,9 @@
/* Loop all sections */
for (i = 0; i < pFileHeader->NumberOfSections; i++)
{
- /* Skip empty sections */
- if (pSectionHeader->SizeOfRawData == 0) continue;
-
/* Check if this is '.text' section */
- if (strcmp(pSectionHeader->Name, ".text") == 0)
+ if ((strcmp(pSectionHeader->Name, ".text") == 0) &&
+ (pSectionHeader->SizeOfRawData != 0))
{
RelocateSection(pData,
pSectionHeader,