public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Skip DT_RELACOUNT relocs on ia-64/alpha if l_addr == 0
@ 2002-04-03 13:09 Jakub Jelinek
  2002-04-05 16:33 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2002-04-03 13:09 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

As both alpha and ia64 never use addend when relocating relative relocs
(ie. they do M += L) and as prelink -r libc.so.6 saved 15% startup time
on IA-32 for programs using solely -lc, I think this patch might be useful
for IA-64 and Alpha.

BTW: Have you looked at the dl-{s,}brk patch I posted
(http://sources.redhat.com/ml/libc-hacker/2002-03/msg00100.html)?

2002-04-03  Jakub Jelinek  <jakub@redhat.com>

	* elf/do-rel.h (elf_dynamic_do_rel): Skip relative relocs if
	l_addr == 0 and ELF_MACHINE_REL_RELATIVE.
	* sysdeps/alpha/dl-machine.h (ELF_MACHINE_REL_RELATIVE): Define.
	* sysdeps/ia64/dl-machine.h (ELF_MACHINE_REL_RELATIVE): Define.

--- libc/elf/do-rel.h.jj	Mon Feb  4 17:34:51 2002
+++ libc/elf/do-rel.h	Wed Apr  3 22:47:19 2002
@@ -83,11 +83,12 @@ elf_dynamic_do_rel (struct link_map *map
       weak_extern (GL(dl_rtld_map));
 # endif
       if (map != &GL(dl_rtld_map)) /* Already done in rtld itself.  */
-# ifndef DO_RELA
+# if !defined DO_RELA || defined ELF_MACHINE_REL_RELATIVE
 	/* Rela platforms get the offset from r_addend and this must
 	   be copied in the relocation address.  Therefore we can skip
 	   the relative relocations only if this is for rel
-	   relocations...  */
+	   relocations or rela relocations if they are computed as
+	   memory_loc += l_addr...  */
 	if (l_addr != 0)
 # else
 	/* ...or we know the object has been prelinked.  */
--- libc/sysdeps/alpha/dl-machine.h.jj	Sat Mar 23 11:51:04 2002
+++ libc/sysdeps/alpha/dl-machine.h	Wed Apr  3 22:49:24 2002
@@ -577,6 +577,10 @@ elf_machine_rela (struct link_map *map,
     }
 }
 
+/* Let do-rel.h know that on Alpha if l_addr is 0, all RELATIVE relocs
+   can be skipped.  */
+#define ELF_MACHINE_REL_RELATIVE 1
+
 static inline void
 elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
 			   Elf64_Addr *const reloc_addr)
--- libc/sysdeps/ia64/dl-machine.h.jj	Sat Mar 23 11:51:45 2002
+++ libc/sysdeps/ia64/dl-machine.h	Wed Apr  3 22:50:02 2002
@@ -577,6 +577,10 @@ elf_machine_rela (struct link_map *map,
     assert (! "unexpected dynamic reloc format");
 }
 
+/* Let do-rel.h know that on IA-64 if l_addr is 0, all RELATIVE relocs
+   can be skipped.  */
+#define ELF_MACHINE_REL_RELATIVE 1
+
 static inline void
 elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
 			   Elf64_Addr *const reloc_addr)

	Jakub

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

* Re: [PATCH] Skip DT_RELACOUNT relocs on ia-64/alpha if l_addr == 0
  2002-04-03 13:09 [PATCH] Skip DT_RELACOUNT relocs on ia-64/alpha if l_addr == 0 Jakub Jelinek
@ 2002-04-05 16:33 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2002-04-05 16:33 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

On Wed, 2002-04-03 at 13:09, Jakub Jelinek wrote:

> As both alpha and ia64 never use addend when relocating relative relocs
> (ie. they do M += L) and as prelink -r libc.so.6 saved 15% startup time
> on IA-32 for programs using solely -lc, I think this patch might be useful
> for IA-64 and Alpha.

Looks OK, I've applied it.  Thanks,

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 232 bytes --]

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

end of thread, other threads:[~2002-04-06  0:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-03 13:09 [PATCH] Skip DT_RELACOUNT relocs on ia-64/alpha if l_addr == 0 Jakub Jelinek
2002-04-05 16:33 ` 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).