summary refs log tree commit diff
path: root/sysdeps/powerpc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-05-16 04:22:23 +0000
committerUlrich Drepper <drepper@redhat.com>2003-05-16 04:22:23 +0000
commit63c7a7e8a99489497572e0cf81aee5c3bc77d1c2 (patch)
treea398a2750f5a65cdedf9ab10aa4ceb637ec014e2 /sysdeps/powerpc
parent115a45a7209e380578d36d83016700c5a2d8252e (diff)
downloadglibc-63c7a7e8a99489497572e0cf81aee5c3bc77d1c2.tar.gz
glibc-63c7a7e8a99489497572e0cf81aee5c3bc77d1c2.tar.xz
glibc-63c7a7e8a99489497572e0cf81aee5c3bc77d1c2.zip
Update.
2003-05-15  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/powerpc/powerpc32/dl-machine.c (_dl_reloc_overflow):
	Remove sym argument, always use refsym.
	(__process_machine_rela): Adjust callers.
	* sysdeps/powerpc/powerpc64/dl-machine.c (_dl_reloc_overflow):
	Likewise.
	* sysdeps/powerpc/powerpc32/dl-machine.h (_dl_reloc_overflow):
	Adjust prototype.
	* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela): Likewise.
Diffstat (limited to 'sysdeps/powerpc')
-rw-r--r--sysdeps/powerpc/powerpc32/dl-machine.c18
-rw-r--r--sysdeps/powerpc/powerpc32/dl-machine.h1
-rw-r--r--sysdeps/powerpc/powerpc64/dl-machine.c8
-rw-r--r--sysdeps/powerpc/powerpc64/dl-machine.h27
4 files changed, 22 insertions, 32 deletions
diff --git a/sysdeps/powerpc/powerpc32/dl-machine.c b/sysdeps/powerpc/powerpc32/dl-machine.c
index 2e071c85af..cf22fc707c 100644
--- a/sysdeps/powerpc/powerpc32/dl-machine.c
+++ b/sysdeps/powerpc/powerpc32/dl-machine.c
@@ -372,22 +372,20 @@ void
 _dl_reloc_overflow (struct link_map *map,
 		    const char *name,
 		    Elf32_Addr *const reloc_addr,
-		    const Elf32_Sym *sym,
 		    const Elf32_Sym *refsym)
 {
   char buffer[128];
   char *t;
-  const Elf32_Sym *errsym = sym ?: refsym;
   t = stpcpy (buffer, name);
   t = stpcpy (t, " relocation at 0x00000000");
   _itoa_word ((unsigned) reloc_addr, t, 16, 0);
-  if (errsym)
+  if (refsym)
     {
       const char *strtab;
 
       strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
       t = stpcpy (t, " for symbol `");
-      t = stpcpy (t, strtab + errsym->st_name);
+      t = stpcpy (t, strtab + refsym->st_name);
       t = stpcpy (t, "'");
     }
   t = stpcpy (t, " out of range");
@@ -424,19 +422,19 @@ __process_machine_rela (struct link_map *map,
 
     case R_PPC_ADDR24:
       if (__builtin_expect (finaladdr > 0x01fffffc && finaladdr < 0xfe000000, 0))
-	_dl_reloc_overflow (map,  "R_PPC_ADDR24", reloc_addr, sym, refsym);
+	_dl_reloc_overflow (map,  "R_PPC_ADDR24", reloc_addr, refsym);
       *reloc_addr = (*reloc_addr & 0xfc000003) | (finaladdr & 0x3fffffc);
       break;
 
     case R_PPC_ADDR16:
       if (__builtin_expect (finaladdr > 0x7fff && finaladdr < 0xffff8000, 0))
-	_dl_reloc_overflow (map,  "R_PPC_ADDR16", reloc_addr, sym, refsym);
+	_dl_reloc_overflow (map,  "R_PPC_ADDR16", reloc_addr, refsym);
       *(Elf32_Half*) reloc_addr = finaladdr;
       break;
 
     case R_PPC_UADDR16:
       if (__builtin_expect (finaladdr > 0x7fff && finaladdr < 0xffff8000, 0))
-	_dl_reloc_overflow (map,  "R_PPC_UADDR16", reloc_addr, sym, refsym);
+	_dl_reloc_overflow (map,  "R_PPC_UADDR16", reloc_addr, refsym);
       ((char *) reloc_addr)[0] = finaladdr >> 8;
       ((char *) reloc_addr)[1] = finaladdr;
       break;
@@ -457,7 +455,7 @@ __process_machine_rela (struct link_map *map,
     case R_PPC_ADDR14_BRTAKEN:
     case R_PPC_ADDR14_BRNTAKEN:
       if (__builtin_expect (finaladdr > 0x7fff && finaladdr < 0xffff8000, 0))
-	_dl_reloc_overflow (map,  "R_PPC_ADDR14", reloc_addr, sym, refsym);
+	_dl_reloc_overflow (map,  "R_PPC_ADDR14", reloc_addr, refsym);
       *reloc_addr = (*reloc_addr & 0xffff0003) | (finaladdr & 0xfffc);
       if (rinfo != R_PPC_ADDR14)
 	*reloc_addr = ((*reloc_addr & 0xffdfffff)
@@ -469,7 +467,7 @@ __process_machine_rela (struct link_map *map,
       {
 	Elf32_Sword delta = finaladdr - (Elf32_Word) reloc_addr;
 	if (delta << 6 >> 6 != delta)
-	  _dl_reloc_overflow (map,  "R_PPC_REL24", reloc_addr, sym, refsym);
+	  _dl_reloc_overflow (map,  "R_PPC_REL24", reloc_addr, refsym);
 	*reloc_addr = (*reloc_addr & 0xfc000003) | (delta & 0x3fffffc);
       }
       break;
@@ -568,7 +566,7 @@ __process_machine_rela (struct link_map *map,
     inline void do_reloc16 (const char *r_name, Elf32_Addr value)
       {
 	if (__builtin_expect (value > 0x7fff && value < 0xffff8000, 0))
-	  _dl_reloc_overflow (map, r_name, reloc_addr, sym, refsym);
+	  _dl_reloc_overflow (map, r_name, reloc_addr, refsym);
 	*(Elf32_Half *) reloc_addr = value;
       }
     inline void do_reloc16_LO (const char *r_name, Elf32_Addr value)
diff --git a/sysdeps/powerpc/powerpc32/dl-machine.h b/sysdeps/powerpc/powerpc32/dl-machine.h
index e26c2d544b..0260ac88f8 100644
--- a/sysdeps/powerpc/powerpc32/dl-machine.h
+++ b/sysdeps/powerpc/powerpc32/dl-machine.h
@@ -347,7 +347,6 @@ extern void __process_machine_rela (struct link_map *map,
 extern void _dl_reloc_overflow (struct link_map *map,
 				const char *name,
 				Elf32_Addr *const reloc_addr,
-				const Elf32_Sym *sym,
 				const Elf32_Sym *refsym) attribute_hidden;
 
 /* Perform the relocation specified by RELOC and SYM (which is fully resolved).
diff --git a/sysdeps/powerpc/powerpc64/dl-machine.c b/sysdeps/powerpc/powerpc64/dl-machine.c
index bbaedc8335..167af998a7 100644
--- a/sysdeps/powerpc/powerpc64/dl-machine.c
+++ b/sysdeps/powerpc/powerpc64/dl-machine.c
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation functions.  PowerPC64 version.
-   Copyright (C) 1995,96,97,98,99,2000,01, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -27,22 +27,20 @@ void
 _dl_reloc_overflow (struct link_map *map,
 		   const char *name,
 		   Elf64_Addr *const reloc_addr,
-		   const Elf64_Sym *sym,
 		   const Elf64_Sym *refsym)
 {
   char buffer[128];
   char *t;
-  const Elf64_Sym *errsym = sym ?: refsym;
   t = stpcpy (buffer, name);
   t = stpcpy (t, " reloc at 0x");
   _itoa_word ((unsigned long) reloc_addr, t, 16, 0);
-  if (errsym)
+  if (refsym)
     {
       const char *strtab;
 
       strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
       t = stpcpy (t, " for symbol `");
-      t = stpcpy (t, strtab + errsym->st_name);
+      t = stpcpy (t, strtab + refsym->st_name);
       t = stpcpy (t, "'");
     }
   t = stpcpy (t, " out of range");
diff --git a/sysdeps/powerpc/powerpc64/dl-machine.h b/sysdeps/powerpc/powerpc64/dl-machine.h
index e965d6a4e9..1922d2a01a 100644
--- a/sysdeps/powerpc/powerpc64/dl-machine.h
+++ b/sysdeps/powerpc/powerpc64/dl-machine.h
@@ -533,7 +533,6 @@ elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc,
 extern void _dl_reloc_overflow (struct link_map *map,
                                 const char *name,
                                 Elf64_Addr *const reloc_addr,
-                                const Elf64_Sym *sym,
                                 const Elf64_Sym *refsym)
                                 attribute_hidden;
 
@@ -637,8 +636,7 @@ elf_machine_rela (struct link_map *map,
     case R_PPC64_TPREL16_LO_DS:
       value = elf_machine_tprel (map, sym_map, sym, reloc);
       if (dont_expect ((value & 3) != 0))
-        _dl_reloc_overflow (map, "R_PPC64_TPREL16_LO_DS",
-                            reloc_addr, sym, refsym);
+        _dl_reloc_overflow (map, "R_PPC64_TPREL16_LO_DS", reloc_addr, refsym);
       *(Elf64_Half *) reloc_addr = BIT_INSERT (*(Elf64_Half *) reloc_addr,
 					       value, 0xfffc);
       break;
@@ -646,8 +644,7 @@ elf_machine_rela (struct link_map *map,
     case R_PPC64_TPREL16_DS:
       value = elf_machine_tprel (map, sym_map, sym, reloc);
       if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0))
-        _dl_reloc_overflow (map, "R_PPC64_TPREL16_DS", reloc_addr,
-                            sym, refsym);
+        _dl_reloc_overflow (map, "R_PPC64_TPREL16_DS", reloc_addr, refsym);
       *(Elf64_Half *) reloc_addr = BIT_INSERT (*(Elf64_Half *) reloc_addr,
 					       value, 0xfffc);
       break;
@@ -655,8 +652,7 @@ elf_machine_rela (struct link_map *map,
     case R_PPC64_TPREL16:
       value = elf_machine_tprel (map, sym_map, sym, reloc);
       if (dont_expect ((value + 0x8000) >= 0x10000))
-        _dl_reloc_overflow (map, "R_PPC64_TPREL16", reloc_addr,
-                            sym, refsym);
+        _dl_reloc_overflow (map, "R_PPC64_TPREL16", reloc_addr, refsym);
       *(Elf64_Half *) reloc_addr = PPC_LO (value);
       break;
 
@@ -699,8 +695,7 @@ elf_machine_rela (struct link_map *map,
 #ifndef RTLD_BOOTSTRAP /* None of the following appear in ld.so */
     case R_PPC64_ADDR16_LO_DS:
       if (dont_expect ((value & 3) != 0))
-        _dl_reloc_overflow (map, "R_PPC64_ADDR16_LO_DS",
-                            reloc_addr, sym, refsym);
+        _dl_reloc_overflow (map, "R_PPC64_ADDR16_LO_DS", reloc_addr, refsym);
       BIT_INSERT (*(Elf64_Half *) reloc_addr, value, 0xfffc);
       break;
 
@@ -721,7 +716,7 @@ elf_machine_rela (struct link_map *map,
         Elf64_Addr delta = value - (Elf64_Xword) reloc_addr;
         if (dont_expect ((delta + 0x80000000) >= 0x10000000
 			 || (delta & 3) != 0))
-          _dl_reloc_overflow (map, "R_PPC64_ADDR30", reloc_addr, sym, refsym);
+          _dl_reloc_overflow (map, "R_PPC64_ADDR30", reloc_addr, refsym);
         BIT_INSERT (*(Elf64_Word *) reloc_addr, delta, 0xfffffffc);
       }
       break;
@@ -767,25 +762,25 @@ elf_machine_rela (struct link_map *map,
 
     case R_PPC64_ADDR32:
       if (dont_expect ((value + 0x80000000) >= 0x10000000))
-        _dl_reloc_overflow (map, "R_PPC64_ADDR32", reloc_addr, sym, refsym);
+        _dl_reloc_overflow (map, "R_PPC64_ADDR32", reloc_addr, refsym);
       *(Elf64_Word *) reloc_addr = value;
       return;
 
     case R_PPC64_ADDR24:
       if (dont_expect ((value + 0x2000000) >= 0x4000000 || (value & 3) != 0))
-        _dl_reloc_overflow (map, "R_PPC64_ADDR24", reloc_addr, sym, refsym);
+        _dl_reloc_overflow (map, "R_PPC64_ADDR24", reloc_addr, refsym);
       BIT_INSERT (*(Elf64_Word *) reloc_addr, value, 0x3fffffc);
       break;
 
     case R_PPC64_ADDR16:
       if (dont_expect ((value + 0x8000) >= 0x10000))
-        _dl_reloc_overflow (map, "R_PPC64_ADDR16", reloc_addr, sym, refsym);
+        _dl_reloc_overflow (map, "R_PPC64_ADDR16", reloc_addr, refsym);
       *(Elf64_Half *) reloc_addr = value;
       break;
 
     case R_PPC64_UADDR16:
       if (dont_expect ((value + 0x8000) >= 0x10000))
-        _dl_reloc_overflow (map, "R_PPC64_UADDR16", reloc_addr, sym, refsym);
+        _dl_reloc_overflow (map, "R_PPC64_UADDR16", reloc_addr, refsym);
       /* We are big-endian.  */
       ((char *) reloc_addr)[0] = (value >> 8) & 0xff;
       ((char *) reloc_addr)[1] = (value >> 0) & 0xff;
@@ -793,7 +788,7 @@ elf_machine_rela (struct link_map *map,
 
     case R_PPC64_ADDR16_DS:
       if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0))
-        _dl_reloc_overflow (map, "R_PPC64_ADDR16_DS", reloc_addr, sym, refsym);
+        _dl_reloc_overflow (map, "R_PPC64_ADDR16_DS", reloc_addr, refsym);
       BIT_INSERT (*(Elf64_Half *) reloc_addr, value, 0xfffc);
       break;
 
@@ -818,7 +813,7 @@ elf_machine_rela (struct link_map *map,
     case R_PPC64_ADDR14_BRNTAKEN:
       {
         if (dont_expect ((value + 0x8000) >= 0x10000 || (value & 3) != 0))
-	  _dl_reloc_overflow (map, "R_PPC64_ADDR14", reloc_addr, sym, refsym);
+	  _dl_reloc_overflow (map, "R_PPC64_ADDR14", reloc_addr, refsym);
         Elf64_Word insn = *(Elf64_Word *) reloc_addr;
         BIT_INSERT (insn, value, 0xfffc);
         if (r_type != R_PPC64_ADDR14)