Source-Changes-HG archive

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

[src/trunk]: src/libexec/ld.elf_so PowerPC: support ADDR16_LO, ADDR16_HI and ...



details:   https://anonhg.NetBSD.org/src/rev/4cdbfd1f83a7
branches:  trunk
changeset: 485577:4cdbfd1f83a7
user:      kleink <kleink%NetBSD.org@localhost>
date:      Mon May 01 11:41:08 2000 +0000

description:
PowerPC: support ADDR16_LO, ADDR16_HI and ADDR16_HA relocations.

diffstat:

 libexec/ld.elf_so/reloc.c |  29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diffs (43 lines):

diff -r cc1a09e7245c -r 4cdbfd1f83a7 libexec/ld.elf_so/reloc.c
--- a/libexec/ld.elf_so/reloc.c Mon May 01 10:52:29 2000 +0000
+++ b/libexec/ld.elf_so/reloc.c Mon May 01 11:41:08 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: reloc.c,v 1.25 2000/02/07 21:40:41 scottb Exp $         */
+/*     $NetBSD: reloc.c,v 1.26 2000/05/01 11:41:08 kleink Exp $         */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -388,6 +388,33 @@
                break;
 #endif /* __powerpc__ || __vax__ */
 
+#if defined(__powerpc__)
+       case R_TYPE(16_LO):     /* #lo(S + A) */
+               tmp = (Elf_Addr)(obj->relocbase + rela->r_addend);
+               if (*(Elf32_Half *)where != tmp)
+                       *(Elf32_Half *)where = tmp;
+               rdbg(dodebug, ("16_LO in %s --> %p", obj->path,
+                   (void *)*where));
+               break;
+
+       case R_TYPE(16_HI):     /* #hi(S + A) */
+               tmp = (Elf_Addr)(obj->relocbase + rela->r_addend) >> 16;
+               if (*(Elf32_Half *)where != tmp)
+                       *(Elf32_Half *)where = tmp;
+               rdbg(dodebug, ("16_HI in %s --> %p", obj->path,
+                   (void *)*where));
+               break;
+
+       case R_TYPE(16_HA):     /* #ha(S + A) */
+               tmp = (Elf_Addr)(obj->relocbase + rela->r_addend + 0x8000)
+                   >> 16;
+               if (*(Elf32_Half *)where != tmp)
+                       *(Elf32_Half *)where = tmp;
+               rdbg(dodebug, ("16_HA in %s --> %p", obj->path,
+                   (void *)*where));
+               break;
+#endif /* __powerpc__ */
+
 #if defined(__vax__)
        case R_TYPE(REL32):
                def = _rtld_find_symdef(_rtld_objlist, rela->r_info, NULL, obj,



Home | Main Index | Thread Index | Old Index