Index: cpukit/include/rtems/rtl/rtl-allocator.h
===================================================================
--- cpukit/include/rtems/rtl/rtl-allocator.h	(revision bdec62c4d5aa25e5a98b9fafe78936a7beb96a6e)
+++ cpukit/include/rtems/rtl/rtl-allocator.h	(revision 22afb03411133bcf928aeb85233648a94f259b44)
@@ -51,4 +51,6 @@
   RTEMS_RTL_ALLOC_NEW,        /**< Allocate new memory. */
   RTEMS_RTL_ALLOC_DEL,        /**< Delete allocated memory. */
+  RTEMS_RTL_ALLOC_LOCK,       /**< Lock the allocator. */
+  RTEMS_RTL_ALLOC_UNLOCK,     /**< Unlock the allocator. */
   RTEMS_RTL_ALLOC_WR_ENABLE,  /**< Enable writes to the memory. */
   RTEMS_RTL_ALLOC_WR_DISABLE, /**< Disable writes to the memory. */
@@ -121,4 +123,22 @@
  */
 void rtems_rtl_alloc_del (rtems_rtl_alloc_tag tag, void* address);
+
+/**
+ * The Runtime Loader allocator lock. An allocator that depends on a
+ * separate allocation process, for example the heap, may need to be
+ * locked during loading of an object file to make sure the locality
+ * of the memory. This call be used to lock such an allocator.
+ *  Allocator calls in this interface are protected by the RTL lock.
+ */
+void rtems_rtl_alloc_lock (void);
+
+/**
+ * The Runtime Loader allocator unlock. An allocator that depends on a
+ * separate allocation process, for example the heap, may need to be
+ * locked during loading of an object file to make sure the locality
+ * of the memory. This call can be used to unlock such an allocator.
+ * Allocator calls in this interface are protected by the RTL lock.
+ */
+void rtems_rtl_alloc_unlock (void);
 
 /**
Index: cpukit/libdl/rtl-alloc-heap.c
===================================================================
--- cpukit/libdl/rtl-alloc-heap.c	(revision bdec62c4d5aa25e5a98b9fafe78936a7beb96a6e)
+++ cpukit/libdl/rtl-alloc-heap.c	(revision 22afb03411133bcf928aeb85233648a94f259b44)
@@ -18,4 +18,6 @@
 #include "rtl-alloc-heap.h"
 
+#include <rtems/score/apimutex.h>
+
 void
 rtems_rtl_alloc_heap (rtems_rtl_alloc_cmd cmd,
@@ -24,10 +26,21 @@
                       size_t              size)
 {
-  if (cmd == RTEMS_RTL_ALLOC_NEW)
-    *address = malloc (size);
-  else if (cmd == RTEMS_RTL_ALLOC_DEL)
+  switch (cmd)
   {
-    free (*address);
-    *address = NULL;
+    case RTEMS_RTL_ALLOC_NEW:
+      *address = malloc (size);
+      break;
+    case RTEMS_RTL_ALLOC_DEL:
+      free (*address);
+      *address = NULL;
+      break;
+    case RTEMS_RTL_ALLOC_LOCK:
+      _RTEMS_Lock_allocator();
+      break;
+    case RTEMS_RTL_ALLOC_UNLOCK:
+      _RTEMS_Unlock_allocator();
+      break;
+    default:
+      break;
   }
 }
Index: cpukit/libdl/rtl-allocator.c
===================================================================
--- cpukit/libdl/rtl-allocator.c	(revision bdec62c4d5aa25e5a98b9fafe78936a7beb96a6e)
+++ cpukit/libdl/rtl-allocator.c	(revision 22afb03411133bcf928aeb85233648a94f259b44)
@@ -109,4 +109,38 @@
 
 void
+rtems_rtl_alloc_lock (void)
+{
+  rtems_rtl_data* rtl = rtems_rtl_lock ();
+
+  if (rtems_rtl_trace (RTEMS_RTL_TRACE_ALLOCATOR))
+    printf ("rtl: alloc: lock\n");
+
+  if (rtl != NULL)
+    rtl->allocator.allocator (RTEMS_RTL_ALLOC_LOCK,
+                              RTEMS_RTL_ALLOC_OBJECT, /* should be ignored */
+                              NULL,
+                              0);
+
+  rtems_rtl_unlock ();
+}
+
+
+void
+rtems_rtl_alloc_unlock (void)
+{
+  rtems_rtl_data* rtl = rtems_rtl_lock ();
+
+  if (rtems_rtl_trace (RTEMS_RTL_TRACE_ALLOCATOR))
+    printf ("rtl: alloc: unlock\n");
+
+  if (rtl != NULL)
+    rtl->allocator.allocator (RTEMS_RTL_ALLOC_UNLOCK,
+                              RTEMS_RTL_ALLOC_OBJECT, /* should be ignored */
+                              NULL,
+                              0);
+
+  rtems_rtl_unlock ();
+}
+void
 rtems_rtl_alloc_wr_disable (rtems_rtl_alloc_tag tag, void* address)
 {
Index: cpukit/libdl/rtl-elf.c
===================================================================
--- cpukit/libdl/rtl-elf.c	(revision bdec62c4d5aa25e5a98b9fafe78936a7beb96a6e)
+++ cpukit/libdl/rtl-elf.c	(revision 22afb03411133bcf928aeb85233648a94f259b44)
@@ -1458,4 +1458,10 @@
 
   /*
+   * Lock the allocator so the section memory and the trampoline memory are as
+   * clock as possible.
+   */
+  rtems_rtl_alloc_lock ();
+
+  /*
    * Allocate the sections.
    */
@@ -1482,4 +1488,9 @@
     return false;
 
+  /*
+   * Unlock the allocator.
+   */
+  rtems_rtl_alloc_unlock ();
+
   if (!rtems_rtl_obj_load_symbols (obj, fd, rtems_rtl_elf_symbols, &ehdr))
     return false;
