public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix prelinking on ppc32
@ 2003-04-15 15:02 Jakub Jelinek
  2003-04-15 19:43 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2003-04-15 15:02 UTC (permalink / raw)
  To: Ulrich Drepper, Roland McGrath; +Cc: Glibc hackers

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@redhat.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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix prelinking on ppc32
  2003-04-15 15:02 [PATCH] Fix prelinking on ppc32 Jakub Jelinek
@ 2003-04-15 19:43 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2003-04-15 19:43 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Roland McGrath, Glibc hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've applied the patch.  Thanks,

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+nGDD2ijCOnn/RHQRAiuCAKC3BkeWyIYlAMsEwmmonRwMgerYDACdGARr
8C54wi1QQSs98lXt/Ngc8Uo=
=jrn5
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-15 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-15 15:02 [PATCH] Fix prelinking on ppc32 Jakub Jelinek
2003-04-15 19:43 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).