* [PATCH] Fix dl-conflict.c on ppc64
@ 2003-05-31 21:34 Jakub Jelinek
2003-06-01 1:31 ` Ulrich Drepper
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2003-05-31 21:34 UTC (permalink / raw)
To: Ulrich Drepper, Roland McGrath; +Cc: Glibc hackers, Steve Munroe
Hi!
As sym_map is always NULL in dl-conflict.c, elf_machine_fixup_plt would do
nothing during conflict processing. I created a new function for this,
as R_PPC64_JMP_SLOT conflicts can be handled way easier than normal
R_PPC64_JMP_SLOT relocs (e.g. .opd is guaranteed to be already relocated,
there is no need to bother with thread safety, etc.).
2003-05-31 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_plt_conflict):
New function.
(elf_machine_rela) <case R_PPC64_JMP_SLOT>: Avoid
RESOLVE_CONFLICT_FIND_MAP. If RESOLVE_CONFLICT_FIND_MAP is defined,
call elf_machine_plt_conflict instead of elf_machine_fixup_plt.
--- libc/sysdeps/powerpc/powerpc64/dl-machine.h.jj 2003-05-26 09:44:32.000000000 -0400
+++ libc/sysdeps/powerpc/powerpc64/dl-machine.h 2003-05-31 17:25:57.000000000 -0400
@@ -506,6 +506,21 @@ elf_machine_fixup_plt (struct link_map *
return finaladdr;
}
+static inline void
+elf_machine_plt_conflict (Elf64_Addr *reloc_addr, Elf64_Addr finaladdr)
+{
+ Elf64_FuncDesc *plt = (Elf64_FuncDesc *) reloc_addr;
+ Elf64_FuncDesc *rel = (Elf64_FuncDesc *) finaladdr;
+
+ plt->fd_func = rel->fd_func;
+ plt->fd_aux = rel->fd_aux;
+ plt->fd_toc = rel->fd_toc;
+ PPC_DCBST (&plt->fd_func);
+ PPC_DCBST (&plt->fd_aux);
+ PPC_DCBST (&plt->fd_toc);
+ PPC_SYNC;
+}
+
/* Return the final value of a plt relocation. */
static inline Elf64_Addr
elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc,
@@ -603,9 +618,10 @@ elf_machine_rela (struct link_map *map,
case R_PPC64_JMP_SLOT:
#ifdef RESOLVE_CONFLICT_FIND_MAP
- RESOLVE_CONFLICT_FIND_MAP (map, reloc_addr);
-#endif
+ elf_machine_plt_conflict (reloc_addr, value);
+#else
elf_machine_fixup_plt (map, sym_map, reloc, reloc_addr, value);
+#endif
return;
#if defined USE_TLS && (!defined RTLD_BOOTSTRAP || USE___THREAD)
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix dl-conflict.c on ppc64
2003-05-31 21:34 [PATCH] Fix dl-conflict.c on ppc64 Jakub Jelinek
@ 2003-06-01 1:31 ` Ulrich Drepper
0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2003-06-01 1:31 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Roland McGrath, Glibc hackers, Steve Munroe
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jakub Jelinek wrote:
> 2003-05-31 Jakub Jelinek <jakub@redhat.com>
>
> * sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_plt_conflict):
> New function.
> (elf_machine_rela) <case R_PPC64_JMP_SLOT>: Avoid
> RESOLVE_CONFLICT_FIND_MAP. If RESOLVE_CONFLICT_FIND_MAP is defined,
> call elf_machine_plt_conflict instead of elf_machine_fixup_plt.
I've added the patch.
- --
- --------------. ,-. 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)
iD4DBQE+2VdS2ijCOnn/RHQRAiSpAJigyNIC/DDjehLURNtMEsJvvNWvAKCOw3Nn
BbBEq3Mtl6R3KWh4roeHxQ==
=M0gf
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-06-01 1:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-31 21:34 [PATCH] Fix dl-conflict.c on ppc64 Jakub Jelinek
2003-06-01 1:31 ` 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).