gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] Support for little-endian ppc64


From: Jerry James
Subject: Re: [Gcl-devel] Support for little-endian ppc64
Date: Tue, 23 Sep 2014 15:48:57 -0600

On Tue, Sep 23, 2014 at 2:20 PM, Jerry James <address@hidden> wrote:
> I think the patch isn't quite right, because ...

Indeed, it wasn't.  I was trying to write a 32-bit value through a
pointer to a 64-bit value.  That accidentally worked on little endian
ppc64, but did not work out so well on big endian ppc64.  I stole a
function from h/elf64_sparc_reloc_special.h to produce this patch,
which led to a successful build.

--- ./h/elf64_ppcle_reloc.h.orig 2014-09-06 09:45:30.000000000 -0600
+++ ./h/elf64_ppcle_reloc.h 2014-09-23 12:00:00.000000000 -0600
@@ -22,3 +22,6 @@
     case R_PPC64_TOC:
       store_val(where,~0L,toc->st_value);
       break;
+    case R_PPC64_REL32:
+      store_ival((int *)where,~0L,(s+a-p));
+      break;
--- ./h/elf64_ppcle_reloc_special.h.orig 2014-09-06 09:45:30.000000000 -0600
+++ ./h/elf64_ppcle_reloc_special.h 2014-09-23 12:00:00.000000000 -0600
@@ -63,3 +63,12 @@ label_got_symbols(void *v1,Shdr *sec1,Sh
   return 0;

 }
+
+static int
+store_ival(int *w,ul m,ul v) {
+
+  *w=(v&m)|(*w&~m);
+
+  return 0;
+
+}
--- ./h/elf64_ppc_reloc.h.orig 2014-09-06 09:45:30.000000000 -0600
+++ ./h/elf64_ppc_reloc.h 2014-09-23 12:00:00.000000000 -0600
@@ -17,3 +17,6 @@
     case R_PPC64_TOC:
       store_val(where,~0L,toc);
       break;
+    case R_PPC64_REL32:
+      store_ival((int *)where,~0L,(s+a-p));
+      break;
--- ./h/elf64_ppc_reloc_special.h.orig 2014-09-06 09:45:30.000000000 -0600
+++ ./h/elf64_ppc_reloc_special.h 2014-09-23 12:00:00.000000000 -0600
@@ -86,3 +86,12 @@ label_got_symbols(void *v1,Shdr *sec1,Sh
   return 0;

 }
+
+static int
+store_ival(int *w,ul m,ul v) {
+
+  *w=(v&m)|(*w&~m);
+
+  return 0;
+
+}

Regards,
-- 
Jerry James
http://www.jamezone.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]