Author: tkreuzer Date: Thu Jun 9 17:59:47 2011 New Revision: 52159
URL: http://svn.reactos.org/svn/reactos?rev=52159&view=rev Log: [OBJ2BIN] - Skip empty sections. ML for x86 adds those, while ML (not ML64) for x64 doesn't.
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?rev... ============================================================================== --- trunk/reactos/tools/obj2bin/obj2bin.c [iso-8859-1] (original) +++ trunk/reactos/tools/obj2bin/obj2bin.c [iso-8859-1] Thu Jun 9 17:59:47 2011 @@ -110,6 +110,9 @@ return -5; }
+ /* Skip empty sections */ + if (SectionHeader.SizeOfRawData == 0) continue; + /* Check if this is '.text' section */ if (strcmp(SectionHeader.Name, ".text") == 0) break; } @@ -139,7 +142,7 @@ /* Read symbol data */ if (!fread(pSymbols, nSize, 1, pSourceFile)) { - fprintf(stderr, "Failed to read section %ld file\n", i); + fprintf(stderr, "Failed to read symbols: %ld\n", nSize); return -9; }
@@ -161,7 +164,8 @@ /* Read section data */ if (!fread(pData, SectionHeader.SizeOfRawData, 1, pSourceFile)) { - fprintf(stderr, "Failed to read section %ld file\n", i); + fprintf(stderr, "Failed to read section %ld, at 0x%lx size=0x%lx \n", + i, SectionHeader.PointerToRawData, SectionHeader.SizeOfRawData); return -12; }