[ros-diffs] [arty] 25446: Some additions for relocatable ppc dlls.

arty at svn.reactos.org arty at svn.reactos.org
Sun Jan 14 04:02:44 CET 2007


Author: arty
Date: Sun Jan 14 06:02:43 2007
New Revision: 25446

URL: http://svn.reactos.org/svn/reactos?rev=25446&view=rev
Log:
Some additions for relocatable ppc dlls.

Modified:
    branches/powerpc/reactos/tools/ppc-build/alink/alink.h
    branches/powerpc/reactos/tools/ppc-build/alink/elf.cpp
    branches/powerpc/reactos/tools/ppc-build/alink/output.cpp

Modified: branches/powerpc/reactos/tools/ppc-build/alink/alink.h
URL: http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/tools/ppc-build/alink/alink.h?rev=25446&r1=25445&r2=25446&view=diff
==============================================================================
--- branches/powerpc/reactos/tools/ppc-build/alink/alink.h (original)
+++ branches/powerpc/reactos/tools/ppc-build/alink/alink.h Sun Jan 14 06:02:43 2007
@@ -375,6 +375,7 @@
 #define R_PPC_ADDR16_HI   5
 #define R_PPC_ADDR16_HA   6
 #define R_PPC_REL24       10
+#define R_PPC_PLTREL24    18
 #define R_PPC_UADDR32     24
 #define R_PPC_REL32       26
 #define R_PPC_SECTOFF     33
@@ -397,6 +398,11 @@
 #define IMAGE_REL_PPC_SECRELLO 0x13
 #define IMAGE_REL_PPC_SECRELHI 0x14
 #define IMAGE_REL_PPC_GPREL    0x15
+#define IMAGE_REL_BASED_ABSOLUTE 0
+#define IMAGE_REL_BASED_HIGH     1
+#define IMAGE_REL_BASED_LOW      2
+#define IMAGE_REL_BASED_HIGHLOW  3
+#define IMAGE_REL_BASED_HIGHADJ  4
 
 #define OUTPUT_COM 1
 #define OUTPUT_EXE 2

Modified: branches/powerpc/reactos/tools/ppc-build/alink/elf.cpp
URL: http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/tools/ppc-build/alink/elf.cpp?rev=25446&r1=25445&r2=25446&view=diff
==============================================================================
--- branches/powerpc/reactos/tools/ppc-build/alink/elf.cpp (original)
+++ branches/powerpc/reactos/tools/ppc-build/alink/elf.cpp Sun Jan 14 06:02:43 2007
@@ -306,12 +306,22 @@
 		     elf32sym.st_name);
 
 #if 0
+		const char *segname = 
+		    elf32sym.st_shndx & 0x8000 ? 
+		    "*SPC*" :
+		    (char *)
+		    (&stringList[0] + 
+		     stringListOffsets[elf32hdr.e_shtrndx] + 
+		     elf32shdr[elf32sym.st_shndx].sh_name);
+
 		fprintf(stderr, 
 			"S[%05x] value %08x size %08x info %08x "
-			"other %08x shndx %08x %s\n",
+			"other %08x shndx %08x (%-10s) %s\n",
 			j, 
 			elf32sym.st_value, elf32sym.st_size, elf32sym.st_info,
-			elf32sym.st_other, elf32sym.st_shndx, sym[j].name.c_str());
+			elf32sym.st_other, elf32sym.st_shndx, 
+			segname,
+			sym[j].name.c_str());
 #endif
 		
 		if(!case_sensitive)
@@ -608,6 +618,7 @@
 		reloc->rtype = FIX_PPC_ADDR24;
 		break;
 
+	    case R_PPC_PLTREL24:
 	    case R_PPC_REL24:
 		reloc->rtype = FIX_PPC_REL24;
 		break;

Modified: branches/powerpc/reactos/tools/ppc-build/alink/output.cpp
URL: http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/tools/ppc-build/alink/output.cpp?rev=25446&r1=25445&r2=25446&view=diff
==============================================================================
--- branches/powerpc/reactos/tools/ppc-build/alink/output.cpp (original)
+++ branches/powerpc/reactos/tools/ppc-build/alink/output.cpp Sun Jan 14 06:02:43 2007
@@ -1216,6 +1216,9 @@
         case FIX_SELF_OFS16_2:
 	case FIX_SELF_LBYTE:
 	case FIX_RVA32:
+	case FIX_REL32:
+	case FIX_PPC_REL24:
+	case FIX_PPC_SECTOFF:
                 continue; /* self-relative fixups and RVA fixups don't relocate */
         default:
                 break;
@@ -1260,8 +1263,20 @@
             break;
         case FIX_PTR1632:
         case FIX_OFS32:
-    case FIX_OFS32_2:
+	case FIX_OFS32_2:
             j|= PE_REL_OFS32;
+
+	case FIX_ADDR32:
+	    j = (IMAGE_REL_BASED_HIGHLOW << 12) | (j & 0xfff);
+	    break;
+
+	case FIX_PPC_RVA16LO:
+	    j = (IMAGE_REL_BASED_LOW << 12) | (j & 0xfff);
+	    break;
+
+	case FIX_PPC_RVA16HA:
+	    j = (IMAGE_REL_BASED_HIGHADJ << 12) | (j & 0xfff);
+	    break;
         }
         /* store relocation */
 	put16(relocSect->data, relocSect->length, j);
@@ -2382,6 +2397,7 @@
 
     for(i=0;i<outlist.size();i++)
     {
+	fprintf(stderr, "Segment %08x: %s\n", outlist[i]->getbase(), outlist[i]->name.c_str());
         if(outlist[i] && ((outlist[i]->attr&SEG_ALIGN) !=SEG_ABS))
         {
             /* ensure section is aligned to file-Align */




More information about the Ros-diffs mailing list