This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix prelinking on ppc32


Hi!

When calling elf_machine_rela from dl-conflict.c, sym is NULL, so we
certainly cannot do checks on what it points to.

BTW: Shouldn't most of the TLS handling go into dl-machine.c on PPC32?
I mean, unless there are -fno-pic shared libraries, linker certainly
shouldn't keep any TLS relocs but R_PPC_DTPMOD32, R_PPC_DTPREL32 and
R_PPC_TPREL32 around and thus the rest doesn't hurt if it is slower.

2003-04-15  Jakub Jelinek  <jakub at redhat dot com>

	* sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela): Avoid
	checking R_PPC_RELATIVE, R_PPC_NONE and whether relocation is
	against local symbol in conflict processing.

--- libc/sysdeps/powerpc/powerpc32/dl-machine.h.jj	2003-04-01 04:20:54.000000000 -0500
+++ libc/sysdeps/powerpc/powerpc32/dl-machine.h	2003-04-15 09:08:04.000000000 -0400
@@ -365,6 +365,7 @@ elf_machine_rela (struct link_map *map, 
   struct link_map *sym_map;
 #endif
 
+#ifndef RESOLVE_CONFLICT_FIND_MAP
   if (r_type == R_PPC_RELATIVE)
     {
       *reloc_addr = map->l_addr + reloc->r_addend;
@@ -381,18 +382,21 @@ elf_machine_rela (struct link_map *map, 
     value = map->l_addr;
   else
     {
-#if defined USE_TLS && !defined RTLD_BOOTSTRAP
+# if defined USE_TLS && !defined RTLD_BOOTSTRAP
       sym_map = RESOLVE_MAP (&sym, version, r_type);
       value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
-#else
+# else
       value = RESOLVE (&sym, version, r_type);
-# ifndef RTLD_BOOTSTRAP
+#  ifndef RTLD_BOOTSTRAP
       if (sym != NULL)
-# endif
+#  endif
 	value += sym->st_value;
-#endif
+# endif
     }
   value += reloc->r_addend;
+#else
+  value = reloc->r_addend;
+#endif
 
   /* A small amount of code is duplicated here for speed.  In libc,
      more than 90% of the relocs are R_PPC_RELATIVE; in the X11 shared

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]