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: Camm Maguire
Subject: Re: [Gcl-devel] Support for little-endian ppc64
Date: Tue, 23 Sep 2014 19:50:21 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Greetings, and thanks so much!

Does this work?

> +      store_val(where,MASK(32),(s+a-p));

Take care,


Jerry James <address@hidden> writes:

> 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,

-- 
Camm Maguire                                        address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



reply via email to

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