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/fre... ============================================================================== --- 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);