]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Invoke DL_AFTER_LOAD if defined
authorChris Metcalf <cmetcalf@tilera.com>
Tue, 30 Oct 2012 18:16:18 +0000 (14:16 -0400)
committerChris Metcalf <cmetcalf@tilera.com>
Tue, 30 Oct 2012 18:16:18 +0000 (14:16 -0400)
This hook is useful for any arch-specific functionality that
should be done on loaded objects.  For the tile architecture,
the hook is already provided (though we switch to using the new
macro name with this commit) and implements a simulator notifier
so that the simulator can load Elf symbols to match the object
and generate better error messages for PC's.

Also, remove a spurious definition of DL_UNMAP in dl-runtime.c

ChangeLog
elf/dl-load.c
ports/ChangeLog.tile
ports/sysdeps/tile/dl-machine.h
ports/sysdeps/tile/dl-runtime.c

index e65ea2354e2caf3a1ab53486cc7559c154fbd137..e9a2794a53a1c356f01490d71d62db6048b8db23 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-10-30  Chris Metcalf  <cmetcalf@tilera.com>
 
+       * elf/dl-load.c (_dl_map_object_from_fd): Call DL_AFTER_LOAD
+       if defined.
+
        * nss/nsswitch.h (nss_interface_function): Provide new
        macro for use with NSS functions.
        * grp/initgroups.c: Use new macro.
index 4b57879b9d125af7317818da2c4eb730d3765294..a6955561f3bd7f32ce507138f6b6c7dad58d63a1 100644 (file)
@@ -1580,6 +1580,10 @@ cannot enable executable stack as shared object requires");
     add_name_to_object (l, ((const char *) D_PTR (l, l_info[DT_STRTAB])
                            + l->l_info[DT_SONAME]->d_un.d_val));
 
+#ifdef DL_AFTER_LOAD
+  DL_AFTER_LOAD (l);
+#endif
+
   /* Now that the object is fully initialized add it to the object list.  */
   _dl_add_to_namespace_list (l, nsid);
 
index 63ca021a5cb2cfd666b297aa288e012b9873ddaa..1f04349bc6f2704b440ae03a7d243e072003a33e 100644 (file)
@@ -1,5 +1,10 @@
 2012-10-30  Chris Metcalf  <cmetcalf@tilera.com>
 
+       * sysdeps/tile/dl-machine.h: Use new DL_AFTER_LOAD macro
+       and rename _dl_arch_map_object to _dl_after_load.
+       * sysdeps/tile/dl-runtime.c: Rename _dl_arch_map_object
+       to _dl_after_load and remove spurious DL_UNMAP definition.
+
        * sysdeps/unix/sysv/linux/tile/init-first.c: Use better #include.
        * sysdeps/unix/sysv/linux/tile/gettimeofday.c: Use gettimeofday
        aliases that match existing tile ABI.
index c4413f9e8ab083116c4f718f949f9de894d3d29f..09a29935827e84c5e45e3531ee7b792581320ee4 100644 (file)
@@ -253,8 +253,8 @@ elf_machine_plt_value (struct link_map *map, const ElfW(Rela) *reloc,
 }
 
 /* Support notifying the simulator about new objects. */
-void internal_function _dl_arch_map_object (struct link_map *l);
-#define _dl_arch_map_object _dl_arch_map_object
+void internal_function _dl_after_load (struct link_map *l);
+#define DL_AFTER_LOAD _dl_after_load
 
 /* Names of the architecture-specific auditing callback functions.  */
 #define ARCH_LA_PLTENTER tile_gnu_pltenter
index 0aa211db1704c6807c7997bf29db90f7b2f24753..6864c3ac964aede5d538f1dfe426632e44ff8b69 100644 (file)
@@ -30,7 +30,7 @@
 
 /* Support notifying the simulator about new objects. */
 void internal_function
-_dl_arch_map_object (struct link_map *l)
+_dl_after_load (struct link_map *l)
 {
   int shift;
 
@@ -75,5 +75,3 @@ _dl_unmap (struct link_map *l)
 
   __munmap ((void *) l->l_map_start, l->l_map_end - l->l_map_start);
 }
-
-#define DL_UNMAP(map) _dl_unmap (map)