public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>, Roland McGrath <roland@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Fix prelinking on ppc32
Date: Tue, 15 Apr 2003 15:02:00 -0000	[thread overview]
Message-ID: <20030415150235.GR16629@sunsite.ms.mff.cuni.cz> (raw)

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

             reply	other threads:[~2003-04-15 15:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-15 15:02 Jakub Jelinek [this message]
2003-04-15 19:43 ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030415150235.GR16629@sunsite.ms.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).