diff --git a/elf/dl-fptr.c b/elf/dl-fptr.c
index e068124..0853894 100644
--- a/elf/dl-fptr.c
+++ b/elf/dl-fptr.c
@@ -1,5 +1,5 @@
 /* Manage function descriptors.  Generic version.
-   Copyright (C) 1999-2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999-2004, 2006, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -56,7 +56,12 @@ static struct local
   }
 local =
   {
+#ifndef SHARED
     .root = &local.boot_table,
+#else
+    /* Address of .boot_table is not known until runtime.  */
+    .root = 0,
+#endif
     .npages = 2,
     .boot_table =
       {
@@ -93,6 +98,17 @@ new_fdesc_table (struct local *l, size_t *size)
   return new_table;
 }
 
+/* Must call _dl_fptr_init before using any other function.  */
+void 
+_dl_fptr_init (void)
+{
+  struct local *l;
+
+  ELF_MACHINE_LOAD_ADDRESS (l, local);
+  /* Initialize root once.  */
+  if (__builtin_expect (l->root == 0, 0))
+    l->root = &l->boot_table;
+}
 
 static ElfW(Addr)
 make_fdesc (ElfW(Addr) ip, ElfW(Addr) gp)
diff --git a/sysdeps/generic/dl-fptr.h b/sysdeps/generic/dl-fptr.h
index d47fb7b..b957fbb 100644
--- a/sysdeps/generic/dl-fptr.h
+++ b/sysdeps/generic/dl-fptr.h
@@ -40,6 +40,9 @@ struct link_map;
 
 extern ElfW(Addr) _dl_boot_fptr_table [];
 
+/* Must be called before any other function.  */
+extern void _dl_fptr_init (void);
+
 extern ElfW(Addr) _dl_make_fptr (struct link_map *, const ElfW(Sym) *,
 				 ElfW(Addr));
 
diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
index e462fd3..ae4b6c1 100644
--- a/sysdeps/hppa/dl-machine.h
+++ b/sysdeps/hppa/dl-machine.h
@@ -64,7 +64,8 @@ __hppa_init_bootstrap_fdesc_table (struct link_map *map)
 }
 
 #define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info)		\
-	__hppa_init_bootstrap_fdesc_table (&bootstrap_map);
+	__hppa_init_bootstrap_fdesc_table (&bootstrap_map);	\
+	_dl_fptr_init();
 
 /* Return nonzero iff ELF header is compatible with the running host.  */
 static inline int
