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] Avoid ld.so segfaults on R_PPC64_DTPREL64 relocations


Hi!

Found during prelink testing on ppc64.

2003-06-17  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela)
	<case R_PPC64_DTPREL64>: Don't segfault on undefined symbols.

--- libc/sysdeps/powerpc/powerpc64/dl-machine.h.jj	2003-06-16 14:26:29.000000000 -0400
+++ libc/sysdeps/powerpc/powerpc64/dl-machine.h	2003-06-17 05:42:16.000000000 -0400
@@ -653,7 +653,8 @@ elf_machine_rela (struct link_map *map,
       /* During relocation all TLS symbols are defined and used.
          Therefore the offset is already correct.  */
 # ifndef RTLD_BOOTSTRAP
-      *reloc_addr = TLS_DTPREL_VALUE (sym, reloc);
+      if (sym_map != NULL)
+	*reloc_addr = TLS_DTPREL_VALUE (sym, reloc);
 # endif
       return;
 

	Jakub


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