mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[OBJ2BIN]
Fix handling of empty sections svn path=/trunk/; revision=52363
This commit is contained in:
parent
61c822816d
commit
80aa713b95
1 changed files with 3 additions and 7 deletions
|
@ -63,14 +63,12 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
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 @@ int main(int argc, char *argv[])
|
|||
/* 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,
|
||||
|
|
Loading…
Reference in a new issue