This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] Fix LD_PROFILE for ia64, changes to dl-machine.h (2/2)
- From: Carlos O'Donell <carlos at baldric dot uwo dot ca>
- To: libc-alpha <libc-alpha at sources dot redhat dot com>
- Date: Mon, 26 Apr 2004 00:32:03 -0400
- Subject: [PATCH] Fix LD_PROFILE for ia64, changes to dl-machine.h (2/2)
libc-alpha,
This is the required change to ia64's dl-machine.h to finish the
LD_PROFILE fixes. This function is called from the generic
profile_fixup.
Cheers,
Carlos.
dl-machine.h | 14 ++++++++++++++
1 files changed, 14 insertions(+)
2004-04-25 Carlos O'Donell <carlos@baldric.uwo.ca>
* sysdeps/ia64/dl-machine.h (ELF_MACHINE_PROFILE_FIXUP_PLT,
ELF_MACHINE_SIZEOF_JMP_SLOT): Define.
(elf_machine_profile_fixup_plt): New.
--- libc-orig/sysdeps/ia64/dl-machine.h 2004-03-07 15:36:06.000000000 -0500
+++ libc/sysdeps/ia64/dl-machine.h 2004-04-25 23:40:35.330621672 -0400
@@ -447,6 +447,9 @@
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
#define ELF_MACHINE_JMP_SLOT R_IA64_IPLTLSB
+/* The profiler needs to build a cache of PLT entries of this size: */
+#define ELF_MACHINE_SIZEOF_JMP_SLOT (sizeof(Elf64_Addr)*2)
+
/* According to the IA-64 specific documentation, Rela is always used. */
#define ELF_MACHINE_NO_REL 1
@@ -454,9 +457,6 @@
#define ELF_MACHINE_START_ADDRESS(map, start) \
DL_STATIC_FUNCTION_ADDRESS (map, start)
-#define elf_machine_profile_fixup_plt(l, reloc, rel_addr, value) \
- elf_machine_fixup_plt (l, reloc, rel_addr, value)
-
#define elf_machine_profile_plt(reloc_addr) ((Elf64_Addr) (reloc_addr))
/* Fixup a PLT entry to bounce directly to the function at VALUE. */
@@ -475,6 +475,20 @@
return (Elf64_Addr) reloc_addr;
}
+/* Fixup a PLT cache entry when doing DSO profiling, if "t" is
+ null this indicates the result is cached. */
+#define ELF_MACHINE_PROFILE_FIXUP_PLT elf_machine_profile_fixup_plt
+static inline Elf64_Addr
+elf_machine_profile_fixup_plt (struct link_map *l, lookup_t t,
+ const Elf64_Rela *reloc,
+ Elf64_Addr *reloc_addr, Elf64_Addr value)
+{
+ if (__builtin_expect(t == NULL,1))
+ return (Elf64_Addr) reloc_addr;
+
+ return elf_machine_fixup_plt(l, t, reloc, reloc_addr, value);
+}
+
/* Return the final value of a plt relocation. */
static inline Elf64_Addr
elf_machine_plt_value (struct link_map *map, const Elf64_Rela *reloc,