Index: cpukit/libdl/rtl.c
===================================================================
--- cpukit/libdl/rtl.c	(revision 990adc543816dbba116a8ada21fa3401c655bf4b)
+++ cpukit/libdl/rtl.c	(revision 87b7117ffdbed0afdafc929f1f6d864d6132e96a)
@@ -33,11 +33,4 @@
 
 /**
- * Semaphore configuration to create a mutex.
- */
-#define RTEMS_MUTEX_ATTRIBS \
-  (RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE | \
-   RTEMS_INHERIT_PRIORITY | RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL)
-
-/**
  * Symbol table cache size. They can be big so the cache needs space to work.
  */
@@ -93,7 +86,4 @@
     if (!rtl)
     {
-      rtems_status_code sc;
-      rtems_id          lock;
-
       /*
        * We cannot set an error in this code because there is no RTL data to
@@ -130,24 +120,6 @@
        * Create the RTL lock.
        */
-      sc = rtems_semaphore_create (rtems_build_name ('R', 'T', 'L', 'D'),
-                                   1, RTEMS_MUTEX_ATTRIBS,
-                                   RTEMS_NO_PRIORITY, &lock);
-      if (sc != RTEMS_SUCCESSFUL)
-      {
-        free (rtl);
-        rtems_libio_unlock ();
-        return false;
-      }
-
-      sc = rtems_semaphore_obtain (lock, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-      if (sc != RTEMS_SUCCESSFUL)
-      {
-        rtems_semaphore_delete (lock);
-        free (rtl);
-        rtems_libio_unlock ();
-        return false;
-      }
-
-      rtl->lock = lock;
+      rtems_recursive_mutex_init (&rtl->lock, "Run-Time Linker");
+      rtems_recursive_mutex_lock (&rtl->lock);
 
       /*
@@ -159,5 +131,5 @@
                                         RTEMS_RTL_SYMS_GLOBAL_BUCKETS))
       {
-        rtems_semaphore_delete (lock);
+        rtems_recursive_mutex_destroy (&rtl->lock);
         free (rtl);
         rtems_libio_unlock ();
@@ -169,5 +141,5 @@
       {
         rtems_rtl_symbol_table_close (&rtl->globals);
-        rtems_semaphore_delete (lock);
+        rtems_recursive_mutex_destroy (&rtl->lock);
         free (rtl);
         rtems_libio_unlock ();
@@ -180,5 +152,5 @@
         rtems_rtl_symbol_table_close (&rtl->globals);
         rtems_rtl_unresolved_table_close (&rtl->unresolved);
-        rtems_semaphore_delete (lock);
+        rtems_recursive_mutex_destroy (&rtl->lock);
         free (rtl);
         rtems_libio_unlock ();
@@ -192,5 +164,5 @@
         rtems_rtl_unresolved_table_close (&rtl->unresolved);
         rtems_rtl_symbol_table_close (&rtl->globals);
-        rtems_semaphore_delete (lock);
+        rtems_recursive_mutex_destroy (&rtl->lock);
         free (rtl);
         rtems_libio_unlock ();
@@ -205,5 +177,5 @@
         rtems_rtl_unresolved_table_close (&rtl->unresolved);
         rtems_rtl_symbol_table_close (&rtl->globals);
-        rtems_semaphore_delete (lock);
+        rtems_recursive_mutex_destroy (&rtl->lock);
         free (rtl);
         rtems_libio_unlock ();
@@ -219,5 +191,5 @@
         rtems_rtl_unresolved_table_close (&rtl->unresolved);
         rtems_rtl_symbol_table_close (&rtl->globals);
-        rtems_semaphore_delete (lock);
+        rtems_recursive_mutex_destroy (&rtl->lock);
         free (rtl);
         rtems_libio_unlock ();
@@ -234,5 +206,5 @@
         rtems_rtl_unresolved_table_close (&rtl->unresolved);
         rtems_rtl_symbol_table_close (&rtl->globals);
-        rtems_semaphore_delete (lock);
+        rtems_recursive_mutex_destroy (&rtl->lock);
         free (rtl);
         rtems_libio_unlock ();
@@ -344,34 +316,16 @@
 rtems_rtl_lock (void)
 {
-  rtems_status_code sc;
-
   if (!rtems_rtl_data_init ())
     return NULL;
 
-  sc = rtems_semaphore_obtain (rtl->lock,
-                               RTEMS_WAIT, RTEMS_NO_TIMEOUT);
-  if (sc != RTEMS_SUCCESSFUL)
-  {
-    errno = EINVAL;
-    return NULL;
-  }
+  rtems_recursive_mutex_lock (&rtl->lock);
 
   return rtl;
 }
 
-bool
+void
 rtems_rtl_unlock (void)
 {
-  /*
-   * Not sure any error should be returned or an assert.
-   */
-  rtems_status_code sc;
-  sc = rtems_semaphore_release (rtl->lock);
-  if ((sc != RTEMS_SUCCESSFUL) && (errno == 0))
-  {
-    errno = EINVAL;
-    return false;
-  }
-  return true;
+  rtems_recursive_mutex_unlock (&rtl->lock);
 }
 
