From 262ddc034b33b1986fc7935a937934bd96aebdec Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 9 Jun 2011 17:59:47 +0000 Subject: [PATCH] [OBJ2BIN] - Skip empty sections. ML for x86 adds those, while ML (not ML64) for x64 doesn't. svn path=/trunk/; revision=52159 --- reactos/tools/obj2bin/obj2bin.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reactos/tools/obj2bin/obj2bin.c b/reactos/tools/obj2bin/obj2bin.c index fe40db5065e..21acc94ceda 100644 --- a/reactos/tools/obj2bin/obj2bin.c +++ b/reactos/tools/obj2bin/obj2bin.c @@ -110,6 +110,9 @@ int main(int argc, char *argv[]) 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 @@ int main(int argc, char *argv[]) /* 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 @@ int main(int argc, char *argv[]) /* 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; }