*ProcessedRelocs = malloc(RelocSectionHeader->SizeOfRawData);
if (NULL == *ProcessedRelocs)
{
- fprintf(stderr, "Failed to allocate %lu bytes for relocations\n", RelocSectionHeader->SizeOfRawData);
+ fprintf(stderr, "Failed to allocate %u bytes for relocations\n", (unsigned int)RelocSectionHeader->SizeOfRawData);
return 1;
}
*ProcessedRelocsLength = 0;
OutHeader = malloc(StartOfRawData);
if (NULL == OutHeader)
{
- fprintf(stderr, "Failed to allocate %lu bytes for output file header\n", StartOfRawData);
+ fprintf(stderr, "Failed to allocate %u bytes for output file header\n", (unsigned int)StartOfRawData);
return 1;
}
memset(OutHeader, '\0', StartOfRawData);
PaddedRosSym = malloc(RosSymFileLength);
if (NULL == PaddedRosSym)
{
- fprintf(stderr, "Failed to allocate %lu bytes for padded .rossym\n", RosSymFileLength);
+ fprintf(stderr, "Failed to allocate %u bytes for padded .rossym\n", (unsigned int)RosSymFileLength);
return 1;
}
memcpy(PaddedRosSym, RosSymSection, RosSymLength);
Length = StartOfRawData;
for (Section = 0; Section < OutFileHeader->NumberOfSections; Section++)
{
+ DWORD SizeOfRawData;
if (OutRelocSection == OutSectionHeaders + Section)
{
Data = (void *) ProcessedRelocs;
+ SizeOfRawData = ProcessedRelocsLength;
}
else if (RosSymLength > 0 && Section + 1 == OutFileHeader->NumberOfSections)
{
Data = (void *) PaddedRosSym;
+ SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData;
}
else
{
Data = (void *) ((char *) InData + OutSectionHeaders[Section].PointerToRawData);
+ SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData;
}
- for (i = 0; i < OutSectionHeaders[Section].SizeOfRawData / 2; i++)
+ for (i = 0; i < SizeOfRawData / 2; i++)
{
CheckSum += ((unsigned short*) Data)[i];
CheckSum = 0xffff & (CheckSum + (CheckSum >> 16));
{
if (0 != OutSectionHeaders[Section].SizeOfRawData)
{
+ DWORD SizeOfRawData;
fseek(OutFile, OutSectionHeaders[Section].PointerToRawData, SEEK_SET);
if (OutRelocSection == OutSectionHeaders + Section)
{
Data = (void *) ProcessedRelocs;
+ SizeOfRawData = ProcessedRelocsLength;
}
else if (RosSymLength > 0 && Section + 1 == OutFileHeader->NumberOfSections)
{
Data = (void *) PaddedRosSym;
+ SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData;
}
else
{
Data = (void *) ((char *) InData + OutSectionHeaders[Section].PointerToRawData);
+ SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData;
}
- if (fwrite(Data, 1, OutSectionHeaders[Section].SizeOfRawData, OutFile) !=
- OutSectionHeaders[Section].SizeOfRawData)
+ if (fwrite(Data, 1, SizeOfRawData, OutFile) != SizeOfRawData)
{
perror("Error writing section data\n");
free(PaddedRosSym);
$(addprefix $(INTERMEDIATE_), $(XML_SSPRINTF_SOURCES:.cpp=.o))
$(TOOLS_INT_)ssprintf.o: $(TOOLS_BASE_)ssprintf.cpp $(XML_SSPRINTF_HEADERS) | $(TOOLS_INT)
- $(ECHO_CC)
+ $(ECHO_HOSTCC)
${host_gpp} $(TOOLS_CPPFLAGS) -c $< -o $@
$(TOOLS_INT_)xml.o: $(TOOLS_BASE_)xml.cpp $(XML_SSPRINTF_HEADERS) | $(TOOLS_INT)
- $(ECHO_CC)
+ $(ECHO_HOSTCC)
${host_gpp} $(TOOLS_CPPFLAGS) -c $< -o $@
include tools/bin2c.mak
include tools/buildno/buildno.mak
include tools/gendib/gendib.mak
+include tools/log2lines.mak
+include tools/nci/nci.mak
ifeq ($(ARCH),powerpc)
include tools/ofw_interface/ofw_interface.mak
endif
-include tools/nci/nci.mak
include tools/pefixup.mak
include tools/raddr2line.mak
include tools/rbuild/rbuild.mak
- include tools/rsym.mak
+ include tools/rsym/rsym.mak