[ros-diffs] [arty] 26607: Properly filter sections that aren't in memory.

arty at svn.reactos.org arty at svn.reactos.org
Tue May 1 10:52:59 CEST 2007


Author: arty
Date: Tue May  1 12:52:58 2007
New Revision: 26607

URL: http://svn.reactos.org/svn/reactos?rev=26607&view=rev
Log:
Properly filter sections that aren't in memory.

Modified:
    branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c

Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c
URL: http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c?rev=26607&r1=26606&r2=26607&view=diff
==============================================================================
--- branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c (original)
+++ branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mboot.c Tue May  1 12:52:58 2007
@@ -454,6 +454,7 @@
     for( i = 0; i < shnum; i++ ) 
     {
 	shdr = ELF_SECTION(i);
+	shdr->sh_addr = 0;
 
 	/* Find the PE Header */
 	if (shdr->sh_type == TYPE_PEHEADER)
@@ -534,8 +535,10 @@
 	relstart = shdr->sh_offset;
 	relsize = shdr->sh_type == SHT_RELA ? 12 : 8;
 	numreloc = shdr->sh_size / relsize;
-	targetSection = shdr->sh_info;
-	
+	targetSection = shdr->sh_info - 1;
+
+	if (!ELF_SECTION(targetSection)->sh_addr) continue;
+
 	printf("Found reloc section %d (symbols %d target %d) with %d relocs\n",
 	       i, shdr->sh_link, shdr->sh_info, numreloc);
 	
@@ -554,8 +557,6 @@
 	{
 	    ULONG S,A,P;
 	    
-	    if((j%0x1000)==0) printf(".");
-
 	    /* Get the reloc */
 	    memcpy(&reloc, RelocSection + (j * relsize), sizeof(reloc));
 
@@ -609,8 +610,6 @@
 
 	MmFreeMemory(SymbolSection);
 	MmFreeMemory(RelocSection);
-
-	printf("\n");
     }
 
     MmFreeMemory(sptr);




More information about the Ros-diffs mailing list