Index: bsps/powerpc/gen5200/start/linkcmds.gen5200_base
===================================================================
--- bsps/powerpc/gen5200/start/linkcmds.gen5200_base	(revision 96e4b2231274429569cda56d965bcc11d8009800)
+++ bsps/powerpc/gen5200/start/linkcmds.gen5200_base	(revision ec1dd51aae0cbce0560b3d72a6f86c938340f2fc)
@@ -27,4 +27,13 @@
 RamSize = bsp_ram_size;
 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
+
+/*
+ * The upper layer linker command file may optionally define the symbol
+ * bsp_section_small_data_area_size.  By default, the small data area is
+ * defined by the .sdata and .sbss input sections.  Define
+ * bsp_section_small_data_area_size, if you want to make space available for
+ * dynamically loaded libraries (libdl).  Small memory targets which do not use
+ * libdl, should not define this symbol.
+ */
 
 MEMORY {
@@ -234,4 +243,5 @@
 
 	.sdata : {
+		bsp_section_sdata_begin = .;
 		PROVIDE (_SDA_BASE_ = 32768);
 		*(.sdata .sdata.* .gnu.linkonce.s.*)
@@ -246,4 +256,5 @@
 		 */
 		bsp_section_data_end = .;
+		bsp_section_sdata_end = .;
 	} > RAM
 
@@ -252,5 +263,5 @@
 		 * BSP: Start of bss section
 		 */
-		bsp_section_bss_start = .;
+		bsp_section_sbss_begin = .;
 
 		__bss_start = .;
@@ -261,4 +272,9 @@
 		*(.sbss .sbss.* .gnu.linkonce.sb.*)
 		PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
+		bsp_section_sbss_end = .;
+		bsp_section_sdata_libdl_begin = .;
+		. = DEFINED(bsp_section_small_data_area_size) ?
+		      bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
+		bsp_section_sdata_libdl_end = .;
 
 		. = ALIGN (bsp_section_align);
@@ -266,4 +282,5 @@
 
 	.bss : {
+		bsp_section_bss_start = .;
 		*(COMMON)
 		*(.dynbss)
Index: bsps/powerpc/haleakala/start/linkcmds
===================================================================
--- bsps/powerpc/haleakala/start/linkcmds	(revision 96e4b2231274429569cda56d965bcc11d8009800)
+++ bsps/powerpc/haleakala/start/linkcmds	(revision ec1dd51aae0cbce0560b3d72a6f86c938340f2fc)
@@ -25,4 +25,8 @@
 }
 
+/*
+ * Max sdata/bss.
+ */
+bsp_section_small_data_area_size = 65536;
 
 SECTIONS
@@ -218,8 +222,10 @@
       . = ALIGN (4);
 	  PROVIDE (__SDATA_START__ = .);
+      bsp_section_sdata_begin = .;
       sdata.start = .;
 	  *(.sdata*)
       *(.gnu.linkonce.s.*)
 	  sdata.end = .;
+      bsp_section_sdata_end = .;
 	} > RAM
 
@@ -228,7 +234,13 @@
       . = ALIGN (4);
 	  PROVIDE(__SBSS_START__ = .);
+      bsp_section_sbss_begin = .;
 	  sbss.start = .;
       *(.sbss .sbss.* *.gnu.linkonce.sb.*);
 	  sbss.end = .;
+      bsp_section_sbss_end = .;
+      bsp_section_sdata_libdl_begin = .;
+      . = DEFINED(bsp_section_small_data_area_size) ?
+            bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
+      bsp_section_sdata_libdl_end = .;
     } > RAM
     PROVIDE(__SBSS_END__ = .);
Index: bsps/powerpc/mpc8260ads/start/linkcmds
===================================================================
--- bsps/powerpc/mpc8260ads/start/linkcmds	(revision 96e4b2231274429569cda56d965bcc11d8009800)
+++ bsps/powerpc/mpc8260ads/start/linkcmds	(revision ec1dd51aae0cbce0560b3d72a6f86c938340f2fc)
@@ -101,5 +101,5 @@
      */
 
-    PROVIDE (__CTOR_LIST__ = .);	
+    PROVIDE (__CTOR_LIST__ = .);
     /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */
     *crtbegin.o(.ctors)
@@ -228,13 +228,16 @@
     PROVIDE (_FIXUP_END_ = .);
     PROVIDE (__FIXUP_END__ = .);
-  
+
     .sdata : {
+      bsp_section_sdata_begin = .;
       PROVIDE (_SDA_BASE_ = 32768);
       *(.sdata .sdata.* .gnu.linkonce.s.*)
-    } > ram
- 
+      bsp_section_sdata_end = .;
+  } > ram
+
     .sbss : {
       __bss_start = .;
- 
+      bsp_section_sbss_begin = .;
+
       PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
       *(.scommon)
@@ -242,12 +245,17 @@
       *(.sbss .sbss.* .gnu.linkonce.sb.*)
       PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
-    } > ram
- 
+      bsp_section_sbss_end = .;
+      bsp_section_sdata_libdl_begin = .;
+      . = DEFINED(bsp_section_small_data_area_size) ?
+	      bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
+      bsp_section_sdata_libdl_end = .;
+    } > ram
+
     .sdata2 : {
       PROVIDE (_SDA2_BASE_ = 32768);
- 
+
       *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
     } > ram =0
- 
+
     .sbss2 : {
       *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
Index: bsps/powerpc/shared/start/linkcmds.share
===================================================================
--- bsps/powerpc/shared/start/linkcmds.share	(revision 96e4b2231274429569cda56d965bcc11d8009800)
+++ bsps/powerpc/shared/start/linkcmds.share	(revision ec1dd51aae0cbce0560b3d72a6f86c938340f2fc)
@@ -2,4 +2,5 @@
               "elf32-powerpc")
 OUTPUT_ARCH(powerpc)
+
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
@@ -8,4 +9,14 @@
 	CODE : ORIGIN = 0x3000 , LENGTH = 32M - 0x3000
 }
+
+/*
+ * The upper layer linker command file may optionally define the symbol
+ * bsp_section_small_data_area_size.  By default, the small data area is
+ * defined by the .sdata and .sbss input sections.  Define
+ * bsp_section_small_data_area_size, if you want to make space available for
+ * dynamically loaded libraries (libdl).  Small memory targets which do not use
+ * libdl, should not define this symbol.
+ */
+
 SECTIONS
 {
@@ -216,9 +227,15 @@
      can access them all, and initialized data all before uninitialized, so
      we can shorten the on-disk segment size.  */
-  .sdata	  : { PROVIDE (_SDA_BASE_ = 32768); *(.sdata*) *(.gnu.linkonce.s.*)	} >CODE
+  .sdata : {
+    bsp_section_sdata_begin = .;
+    PROVIDE (_SDA_BASE_ = 32768);
+    *(.sdata*) *(.gnu.linkonce.s.*)
+    bsp_section_sdata_end = .;
+  } > CODE
   _edata  =  .;
   PROVIDE (edata = .);
   .sbss      :
   {
+    bsp_section_sbss_begin = .;
     PROVIDE (__sbss_start = .);
     *(.dynsbss)
@@ -231,4 +248,9 @@
     PROVIDE (__SBSS_END__ = .);
     PROVIDE (__sbss_end = .);
+    bsp_section_sbss_end = .;
+    bsp_section_sdata_libdl_begin = .;
+     . = DEFINED(bsp_section_small_data_area_size) ?
+         bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
+    bsp_section_sdata_libdl_end = .;
   } > CODE
   .plt   : { *(.plt) }	> CODE
Index: bsps/powerpc/ss555/start/linkcmds
===================================================================
--- bsps/powerpc/ss555/start/linkcmds	(revision 96e4b2231274429569cda56d965bcc11d8009800)
+++ bsps/powerpc/ss555/start/linkcmds	(revision ec1dd51aae0cbce0560b3d72a6f86c938340f2fc)
@@ -16,5 +16,5 @@
 
 OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
-OUTPUT_ARCH(powerpc) 
+OUTPUT_ARCH(powerpc)
 STARTUP(start.o)
 ENTRY(start)
@@ -36,5 +36,5 @@
      * For the MPC555, we use the compressed vector table format which puts
      * all of the exception vectors before 0x100.
-     */ 
+     */
     *(.vectors)
   }
@@ -43,5 +43,5 @@
   {
     /* Read-only sections, merged into text segment: */
-    
+
     text.start = .;
 
@@ -55,5 +55,5 @@
     /* C++ constructors/destructors */
     *(.gnu.linkonce.t*)
-	     
+
     /*  Initialization and finalization code.
      *
@@ -66,5 +66,5 @@
      *  ecrtn.o; the linker won't look for a file to match a wildcard.  The
      *  wildcard also means that it doesn't matter which directory ecrti.o
-     *  and ecrtn.o are in. 
+     *  and ecrtn.o are in.
      */
     PROVIDE (_init = .);
@@ -72,5 +72,5 @@
     *(.init)
     *ecrtn.o(.init)
-    
+
     PROVIDE (_fini = .);
     *ecrti.o(.fini)
@@ -78,5 +78,5 @@
     *ecrtn.o(.init)
 
-    /* 
+    /*
      *  C++ constructors and destructors for static objects.
      *  PowerPC EABI does not use crtstuff yet, so we build "old-style"
@@ -84,5 +84,5 @@
      *  end terminate with a NULL entry.
      */
-    PROVIDE (__CTOR_LIST__ = .);	     
+    PROVIDE (__CTOR_LIST__ = .);
     /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */
     *crtbegin.o(.ctors)
@@ -91,5 +91,5 @@
     LONG(0)
     PROVIDE (__CTOR_END__ = .);
-	
+
     PROVIDE (__DTOR_LIST__ = .);
     /* LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) */
@@ -99,5 +99,5 @@
     LONG(0)
     PROVIDE (__DTOR_END__ = .);
-	
+
     /*
      * Special FreeBSD sysctl sections.
@@ -140,6 +140,6 @@
     _TLS_Data_end = .;
 
-    /* 
-     * .data section contents, copied to RAM at system startup. 
+    /*
+     * .data section contents, copied to RAM at system startup.
      */
     . = ALIGN(0x20);
@@ -164,29 +164,29 @@
    */
   . = DEFINED(RTEMS_DEBUG) ? . : int_ram_org;
- 
+
   .data : AT (data.contents.start)
   {
     data.start = .;
-    
+
     *(.data)
     *(.data.*)
     KEEP (*(SORT(.rtemsrwset.*)))
     *(.data1)
-    
+
     PROVIDE (__SDATA_START__ = .);
     *(.sdata .sdata.* .gnu.linkonce.s.*)
     PROVIDE (__SDATA_END__ = .);
-    
+
     PROVIDE (__EXCEPT_START__ = .);
     *(.gcc_except_table*)
     PROVIDE (__EXCEPT_END__ = .);
-    
+
     PROVIDE(__GOT_START__ = .);
-    *(.got.plt) 
+    *(.got.plt)
     *(.got)
     PROVIDE(__GOT_END__ = .);
-	
+
     *(.got1)
-    
+
     PROVIDE (__GOT2_START__ = .);
     PROVIDE (_GOT2_START_ = .);
@@ -194,5 +194,5 @@
     PROVIDE (__GOT2_END__ = .);
     PROVIDE (_GOT2_END_ = .);
-	
+
     PROVIDE (__FIXUP_START__ = .);
     PROVIDE (_FIXUP_START_ = .);
@@ -205,7 +205,9 @@
      */
     PROVIDE (__SDATA2_START__ = .);
+    bsp_section_sdata_begin = .;
     *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
     *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
     PROVIDE (__SDATA2_END__ = .);
+    bsp_section_sdata_end = .;
 
     data.end = .;
@@ -217,12 +219,18 @@
   {
     PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
+    bsp_section_sbss_begin = .;
     *(.dynsbss)
     *(.sbss .sbss.* .gnu.linkonce.sb.*)
     *(.scommon)
     PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
+    bsp_section_sbss_end = .;
+    bsp_section_sdata_libdl_begin = .;
+    . = DEFINED(bsp_section_small_data_area_size) ?
+          bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
+    bsp_section_sdata_libdl_end = .;
   }
   .bss :
   {
-    *(.dynbss)	
+    *(.dynbss)
     *(.bss .bss* .gnu.linkonce.b*)
     *(COMMON)
@@ -248,7 +256,7 @@
   WorkAreaBase = .;
 
- 
-  /* 
-   * Internal I/O devices 
+
+  /*
+   * Internal I/O devices
    */
   .usiu 0x002FC000:		/* unified system interface unit */
@@ -284,5 +292,5 @@
   .stab.indexstr 0 : { *(.stab.indexstr) }
   .comment 0 : { *(.comment) }
-  
+
   /* DWARF debug sections.
      Symbols in the DWARF debugging sections are relative to the beginning
@@ -291,13 +299,13 @@
   .debug          0 : { *(.debug) }
   .line           0 : { *(.line) }
-  
+
   /* GNU DWARF 1 extensions */
   .debug_srcinfo  0 : { *(.debug_srcinfo) }
   .debug_sfnames  0 : { *(.debug_sfnames) }
-  
+
   /* DWARF 1.1 and DWARF 2 */
   .debug_aranges  0 : { *(.debug_aranges) }
   .debug_pubnames 0 : { *(.debug_pubnames) }
-  
+
   /* DWARF 2 */
   .debug_info     0 : { *(.debug_info) }
@@ -308,5 +316,5 @@
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
-  
+
   /* SGI/MIPS DWARF 2 extensions */
   .debug_weaknames 0 : { *(.debug_weaknames) }
Index: bsps/powerpc/virtex4/start/linkcmds
===================================================================
--- bsps/powerpc/virtex4/start/linkcmds	(revision 96e4b2231274429569cda56d965bcc11d8009800)
+++ bsps/powerpc/virtex4/start/linkcmds	(revision ec1dd51aae0cbce0560b3d72a6f86c938340f2fc)
@@ -210,5 +210,9 @@
    */
   /* Initialised small data addressed as offsets from r13 */
-  .sdata          : { PROVIDE (_SDA_BASE_ = 32768); *(.sdata* .gnu.linkonce.s.*)                     } > RAM
+  .sdata          : {
+	bsp_section_sdata_begin = .;
+  	PROVIDE (_SDA_BASE_ = 32768); *(.sdata* .gnu.linkonce.s.*);
+	bsp_section_sdata_end = .;
+   } > RAM
 
   _edata          = .;
@@ -217,4 +221,5 @@
   /* Zeroed small data addressed as offsets from r13 */
   .sbss           : { PROVIDE (__sbss_start = .);
+  		      bsp_section_sbss_begin = .;
                       *(.dynsbss)
                       *(.sbss*)
@@ -229,4 +234,9 @@
                       PROVIDE (__SBSS_END__ = .);
                       PROVIDE (__sbss_end   = .);
+		      bsp_section_sbss_end = .;
+		      bsp_section_sdata_libdl_begin = .;
+		      . = DEFINED(bsp_section_small_data_area_size) ?
+			bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
+		      bsp_section_sdata_libdl_end = .;
                     } > RAM
 
Index: bsps/powerpc/virtex5/start/linkcmds
===================================================================
--- bsps/powerpc/virtex5/start/linkcmds	(revision 96e4b2231274429569cda56d965bcc11d8009800)
+++ bsps/powerpc/virtex5/start/linkcmds	(revision ec1dd51aae0cbce0560b3d72a6f86c938340f2fc)
@@ -210,5 +210,9 @@
    */
   /* Initialised small data addressed as offsets from r13 */
-  .sdata          : { PROVIDE (_SDA_BASE_ = 32768); *(.sdata* .gnu.linkonce.s.*)                     } > RAM
+  .sdata          : {
+	bsp_section_sdata_begin = .;
+  	PROVIDE (_SDA_BASE_ = 32768); *(.sdata* .gnu.linkonce.s.*);
+	bsp_section_sdata_end = .;
+   } > RAM
 
   _edata          = .;
@@ -217,4 +221,5 @@
   /* Zeroed small data addressed as offsets from r13 */
   .sbss           : { PROVIDE (__sbss_start = .);
+  		      bsp_section_sbss_begin = .;
                       *(.dynsbss)
                       *(.sbss*)
@@ -229,4 +234,9 @@
                       PROVIDE (__SBSS_END__ = .);
                       PROVIDE (__sbss_end   = .);
+		      bsp_section_sbss_end = .;
+		      bsp_section_sdata_libdl_begin = .;
+		      . = DEFINED(bsp_section_small_data_area_size) ?
+			bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
+		      bsp_section_sdata_libdl_end = .;
                     } > RAM
 
Index: cpukit/libdl/rtl-mdreloc-powerpc.c
===================================================================
--- cpukit/libdl/rtl-mdreloc-powerpc.c	(revision 96e4b2231274429569cda56d965bcc11d8009800)
+++ cpukit/libdl/rtl-mdreloc-powerpc.c	(revision ec1dd51aae0cbce0560b3d72a6f86c938340f2fc)
@@ -51,9 +51,14 @@
 get_sdata_start (void)
 {
+#if _ARCH_PPC64
+  return NULL;
+#else
   Elf_Addr addr;
   GET_ADDR(__SDATA_START__, addr);
   return (void*) addr;
-}
-
+#endif
+}
+
+#if !_ARCH_PPC64
 static size_t
 get_sdata_sbss_size (void)
@@ -75,4 +80,5 @@
   return end - begin;
 }
+#endif
 
 uint32_t
@@ -90,4 +96,5 @@
                                   const uint32_t       flags)
 {
+#if !_ARCH_PPC64
   struct {
     const char* label;
@@ -105,4 +112,5 @@
       return flags | RTEMS_RTL_OBJ_SECT_ARCH_ALLOC;
   }
+#endif
   return flags;
 }
@@ -112,4 +120,8 @@
                                   rtems_rtl_obj_sect*  sect)
 {
+#if _ARCH_PPC64
+    rtems_rtl_set_error (ENOMEM, ".sdata no supported by ABI");
+    return false;
+#else
   if (rtems_rtl_trace (RTEMS_RTL_TRACE_DETAIL))
     printf ("rtl: section: arch: alloc: name=%s size=%zu flags=%08" PRIx32 \
@@ -139,4 +151,5 @@
 
   return true;
+#endif
 }
 
@@ -145,8 +158,10 @@
                                   rtems_rtl_obj_sect*  sect)
 {
+#if !_ARCH_PPC64
   if (rtems_rtl_trace (RTEMS_RTL_TRACE_DETAIL))
     printf ("rtl: section: arch: free: name=%s size=%zu\n", sect->name, sect->size);
   if (sdata != NULL)
     rtems_rtl_bit_alloc_bfree (sdata, sect->base, sect->size);
+#endif
   return true;
 }
