[rtems commit] Add RTEMS linker sets

Sebastian Huber sebh at rtems.org
Tue Dec 8 12:53:17 UTC 2015


Module:    rtems
Branch:    master
Commit:    b618d8cfc54f84d4ed03dc7b7fa510c872e6128a
Changeset: http://git.rtems.org/rtems/commit/?id=b618d8cfc54f84d4ed03dc7b7fa510c872e6128a

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Sep 16 07:13:58 2015 +0200

Add RTEMS linker sets

Update #2408.

---

 c/src/lib/libbsp/arm/gba/startup/linkcmds          |   2 +
 c/src/lib/libbsp/avr/avrtest/startup/linkcmds      |   2 +
 c/src/lib/libbsp/bfin/TLL6527M/startup/linkcmds    |   2 +
 c/src/lib/libbsp/bfin/bf537Stamp/startup/linkcmds  |   2 +
 c/src/lib/libbsp/bfin/eZKit533/startup/linkcmds    |   2 +
 c/src/lib/libbsp/h8300/h8sim/startup/linkcmds      |   2 +
 c/src/lib/libbsp/lm32/lm32_evr/startup/linkcmds    |   3 +-
 c/src/lib/libbsp/lm32/milkymist/startup/linkcmds   |   3 +-
 c/src/lib/libbsp/m32c/m32cbsp/startup/linkcmds     |   3 +-
 c/src/lib/libbsp/m32r/m32rsim/startup/linkcmds     |   3 +-
 c/src/lib/libbsp/m68k/av5282/startup/linkcmds      |   2 +
 c/src/lib/libbsp/m68k/av5282/startup/linkcmdsflash |   2 +
 c/src/lib/libbsp/m68k/av5282/startup/linkcmdsram   |   2 +
 c/src/lib/libbsp/m68k/csb360/startup/linkcmds      |   2 +
 c/src/lib/libbsp/m68k/gen68302/startup/linkcmds    |   2 +
 c/src/lib/libbsp/m68k/gen68340/startup/linkcmds    |   2 +
 c/src/lib/libbsp/m68k/gen68360/startup/linkcmds    |   2 +
 .../libbsp/m68k/gen68360/startup/linkcmds.bootp    |   2 +
 .../lib/libbsp/m68k/gen68360/startup/linkcmds.prom |   2 +
 c/src/lib/libbsp/m68k/idp/startup/linkcmds         |   2 +
 .../lib/libbsp/m68k/mcf5206elite/startup/linkcmds  |   2 +
 .../m68k/mcf5206elite/startup/linkcmds.flash       |   2 +
 c/src/lib/libbsp/m68k/mcf52235/startup/linkcmds    |   2 +
 c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds    |   2 +
 c/src/lib/libbsp/m68k/mcf5235/startup/linkcmds     |   2 +
 .../lib/libbsp/m68k/mcf5235/startup/linkcmdsflash  |   2 +
 c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsram  |   2 +
 c/src/lib/libbsp/m68k/mcf5329/startup/linkcmds     |   2 +
 .../lib/libbsp/m68k/mcf5329/startup/linkcmdsflash  |   2 +
 c/src/lib/libbsp/m68k/mrm332/startup/linkcmds      |   2 +
 c/src/lib/libbsp/m68k/mvme136/startup/linkcmds     |   2 +
 c/src/lib/libbsp/m68k/mvme147/startup/linkcmds     |   2 +
 c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds    |   2 +
 c/src/lib/libbsp/m68k/mvme162/startup/linkcmds     |   2 +
 c/src/lib/libbsp/m68k/mvme167/startup/linkcmds     |   2 +
 c/src/lib/libbsp/m68k/ods68302/startup/debugger    |   2 +
 c/src/lib/libbsp/m68k/ods68302/startup/linkcmds    |   2 +
 c/src/lib/libbsp/m68k/ods68302/startup/rom         |   2 +
 c/src/lib/libbsp/m68k/uC5282/startup/linkcmds      |   2 +
 c/src/lib/libbsp/mips/csb350/startup/linkcmds      |   2 +
 .../lib/libbsp/mips/genmongoosev/startup/linkcmds  |   2 +
 c/src/lib/libbsp/mips/hurricane/startup/linkcmds   |   2 +
 c/src/lib/libbsp/mips/rbtx4925/startup/linkcmds    |   2 +
 c/src/lib/libbsp/mips/rbtx4938/startup/linkcmds    |   2 +
 c/src/lib/libbsp/moxie/moxiesim/startup/linkcmds   |   3 +-
 c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds  |   3 +-
 c/src/lib/libbsp/powerpc/beatnik/startup/linkcmds  |   3 +-
 c/src/lib/libbsp/powerpc/ep1a/startup/linkcmds     |   3 +-
 .../libbsp/powerpc/gen5200/startup/linkcmds.base   |   2 +
 .../lib/libbsp/powerpc/haleakala/startup/linkcmds  |   2 +
 c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds   |   2 +
 .../lib/libbsp/powerpc/mpc8260ads/startup/linkcmds |   2 +
 c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds  |   3 +-
 .../lib/libbsp/powerpc/score603e/startup/linkcmds  |   3 +-
 c/src/lib/libbsp/powerpc/shared/startup/linkcmds   |   3 +-
 c/src/lib/libbsp/powerpc/ss555/startup/linkcmds    |   2 +
 .../libbsp/powerpc/tqm8xx/startup/linkcmds.base    |   3 +-
 c/src/lib/libbsp/powerpc/virtex4/startup/linkcmds  |   3 +-
 c/src/lib/libbsp/powerpc/virtex5/startup/linkcmds  |   3 +-
 c/src/lib/libbsp/sh/gensh1/startup/linkcmds        |   3 +-
 c/src/lib/libbsp/sh/gensh2/startup/linkcmds        |   3 +-
 c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram    |   3 +-
 c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom    |   3 +-
 c/src/lib/libbsp/sh/gensh4/startup/linkcmds        |   2 +
 c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom    |   2 +
 .../lib/libbsp/sh/gensh4/startup/linkcmds.rom2ram  |   2 +
 c/src/lib/libbsp/sh/shsim/startup/linkcmds.sim     |   3 +-
 c/src/lib/libbsp/sparc64/shared/startup/linkcmds   |   2 +
 c/src/lib/libbsp/v850/gdbv850sim/startup/linkcmds  |   3 +-
 cpukit/score/Makefile.am                           |   1 +
 cpukit/score/include/rtems/linkersets.h            |  96 +++++
 cpukit/score/preinstall.am                         |   4 +
 doc/user/Makefile.am                               |   9 +-
 doc/user/c_user.texi                               |   2 +
 doc/user/example.texi                              |   2 +-
 doc/user/linkersets.t                              | 421 +++++++++++++++++++++
 testsuites/sptests/Makefile.am                     |   1 +
 testsuites/sptests/configure.ac                    |   1 +
 testsuites/sptests/splinkersets01/Makefile.am      |  23 ++
 testsuites/sptests/splinkersets01/init.c           | 152 ++++++++
 testsuites/sptests/splinkersets01/items.c          |  23 ++
 testsuites/sptests/splinkersets01/sets.c           |  23 ++
 .../sptests/splinkersets01/splinkersets01.doc      |  25 ++
 testsuites/sptests/splinkersets01/splinkersets01.h |  40 ++
 .../sptests/splinkersets01/splinkersets01.scn      |   2 +
 85 files changed, 960 insertions(+), 23 deletions(-)

diff --git a/c/src/lib/libbsp/arm/gba/startup/linkcmds b/c/src/lib/libbsp/arm/gba/startup/linkcmds
index 174964a..4c9fee2 100644
--- a/c/src/lib/libbsp/arm/gba/startup/linkcmds
+++ b/c/src/lib/libbsp/arm/gba/startup/linkcmds
@@ -135,6 +135,7 @@ SECTIONS
     *(.rodata1)
     *(EXCLUDE_FILE(*.rodata.* *.ewram.o *.iwram.o) .rodata)
     *(.rodata.* .gnu.linkonce.r*)
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.roda) /* deprecated: for compatibility with objcopyroda */
     SORT(CONSTRUCTORS)
     . = ALIGN(4);
@@ -302,6 +303,7 @@ SECTIONS
     *(EXCLUDE_FILE(*.rodata.* *.ewram.o *.iwram.o) .data)
     *(.data.* .gnu.linkonce.d.*)
     *(.data1)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.sdata .sdata.* .gnu.linkonce.s.*)
     . = ALIGN(4);
   } =0xFF
diff --git a/c/src/lib/libbsp/avr/avrtest/startup/linkcmds b/c/src/lib/libbsp/avr/avrtest/startup/linkcmds
index 7ba1587..46548bf 100644
--- a/c/src/lib/libbsp/avr/avrtest/startup/linkcmds
+++ b/c/src/lib/libbsp/avr/avrtest/startup/linkcmds
@@ -172,8 +172,10 @@ SECTIONS
   {
     *(.data)
     *(.data*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.rodata)  /* We need to include .rodata here if gcc is used */
     *(.rodata*) /* with -fdata-sections.  */
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.gnu.linkonce.d*)
     . = ALIGN(2);
      _edata = . ;
diff --git a/c/src/lib/libbsp/bfin/TLL6527M/startup/linkcmds b/c/src/lib/libbsp/bfin/TLL6527M/startup/linkcmds
index 7e37798..982757c 100644
--- a/c/src/lib/libbsp/bfin/TLL6527M/startup/linkcmds
+++ b/c/src/lib/libbsp/bfin/TLL6527M/startup/linkcmds
@@ -93,6 +93,7 @@ SECTIONS
     .data :
     {
         *(.data)
+        KEEP (*(SORT(.rtemsrwset.*)))
         *(.jcr)
         *(.gnu.linkonce.d*)
         CONSTRUCTORS
@@ -108,6 +109,7 @@ SECTIONS
     {
         *(.rodata)
         *(.rodata.*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
     } > sdram
 
diff --git a/c/src/lib/libbsp/bfin/bf537Stamp/startup/linkcmds b/c/src/lib/libbsp/bfin/bf537Stamp/startup/linkcmds
index 7c1e5e4..795e4de 100644
--- a/c/src/lib/libbsp/bfin/bf537Stamp/startup/linkcmds
+++ b/c/src/lib/libbsp/bfin/bf537Stamp/startup/linkcmds
@@ -101,6 +101,7 @@ SECTIONS
     .data :
     {
         *(.data)
+        KEEP (*(SORT(.rtemsrwset.*)))
         *(.jcr)
         *(.gnu.linkonce.d*)
         CONSTRUCTORS
@@ -116,6 +117,7 @@ SECTIONS
     {
         *(.rodata)
         *(.rodata.*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
     } > sdram
 
diff --git a/c/src/lib/libbsp/bfin/eZKit533/startup/linkcmds b/c/src/lib/libbsp/bfin/eZKit533/startup/linkcmds
index a8f39fb..3315f37 100644
--- a/c/src/lib/libbsp/bfin/eZKit533/startup/linkcmds
+++ b/c/src/lib/libbsp/bfin/eZKit533/startup/linkcmds
@@ -90,6 +90,7 @@ SECTIONS
     .data :
     {
         *(.data)
+        KEEP (*(SORT(.rtemsrwset.*)))
         *(.jcr)
         *(.gnu.linkonce.d*)
         CONSTRUCTORS
@@ -105,6 +106,7 @@ SECTIONS
     {
         *(.rodata)
         *(.rodata.*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
     } > sdram
 
diff --git a/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds b/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds
index 53ed639..0534e05 100644
--- a/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds
+++ b/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds
@@ -56,6 +56,7 @@ SECTIONS
         . = ALIGN (16);
         PROVIDE(_rodata_start = . );
         *(.rodata*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
         PROVIDE(_erodata = . );
 
@@ -88,6 +89,7 @@ SECTIONS
     .data SIZEOF(.tors) + ADDR(.tors):
     {
  	*(.data*)
+        KEEP (*(SORT(.rtemsrwset.*)))
         *(.gcc_exc*)
 	CONSTRUCTORS
 	 _edata = .;
diff --git a/c/src/lib/libbsp/lm32/lm32_evr/startup/linkcmds b/c/src/lib/libbsp/lm32/lm32_evr/startup/linkcmds
index e9c0009..aea7cbf 100644
--- a/c/src/lib/libbsp/lm32/lm32_evr/startup/linkcmds
+++ b/c/src/lib/libbsp/lm32/lm32_evr/startup/linkcmds
@@ -77,7 +77,7 @@ SECTIONS
 
   .fini		  : { _fini = .; KEEP(*(.fini))	} > sdram
 
-  .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) }	> sdram
+  .rodata         : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) }	> sdram
   .rodata1        : { *(.rodata1) }	> sdram
   .tdata : {
     _TLS_Data_begin = .;
@@ -154,6 +154,7 @@ SECTIONS
     */
 	PROVIDE(__DATA_START__ = ABSOLUTE(.) );
     *(.data .data.* .gnu.linkonce.d*)	
+    KEEP (*(SORT(.rtemsrwset.*)))
     SORT(CONSTRUCTORS)
   } > sdram
   .data1   : { *(.data1) }	> sdram
diff --git a/c/src/lib/libbsp/lm32/milkymist/startup/linkcmds b/c/src/lib/libbsp/lm32/milkymist/startup/linkcmds
index d774e66..72466b9 100644
--- a/c/src/lib/libbsp/lm32/milkymist/startup/linkcmds
+++ b/c/src/lib/libbsp/lm32/milkymist/startup/linkcmds
@@ -76,7 +76,7 @@ SECTIONS
 
   .fini		  : { _fini = .; KEEP(*(.fini))	} > sdram
 
-  .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) }	> sdram
+  .rodata         : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) }	> sdram
   .rodata1        : { *(.rodata1) }	> sdram
   .tdata : {
     _TLS_Data_begin = .;
@@ -153,6 +153,7 @@ SECTIONS
     */
 	PROVIDE(__DATA_START__ = ABSOLUTE(.) );
     *(.data .data.* .gnu.linkonce.d*)	
+    KEEP (*(SORT(.rtemsrwset.*)))
     SORT(CONSTRUCTORS)
   } > sdram
   .data1   : { *(.data1) }	> sdram
diff --git a/c/src/lib/libbsp/m32c/m32cbsp/startup/linkcmds b/c/src/lib/libbsp/m32c/m32cbsp/startup/linkcmds
index f3721ad..5f838bc 100644
--- a/c/src/lib/libbsp/m32c/m32cbsp/startup/linkcmds
+++ b/c/src/lib/libbsp/m32c/m32cbsp/startup/linkcmds
@@ -52,7 +52,7 @@ SECTIONS
     *(.plt)
     KEEP (*(.init))
     KEEP (*(.fini))
-    *(.rodata .rodata.* .gnu.linkonce.r.*)
+    *(.rodata .rodata.* KEEP (*(SORT(.rtemsroset.*))) .gnu.linkonce.r.*)
     *(.rodata1)
     *(.eh_frame_hdr)
     KEEP (*(.eh_frame))
@@ -119,6 +119,7 @@ SECTIONS
     *(.dynamic)
 
     *(.data .data.* .gnu.linkonce.d.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     KEEP (*(.gnu.linkonce.d.*personality*))
     SORT(CONSTRUCTORS)
     *(.data1)
diff --git a/c/src/lib/libbsp/m32r/m32rsim/startup/linkcmds b/c/src/lib/libbsp/m32r/m32rsim/startup/linkcmds
index bca3946..018d405 100644
--- a/c/src/lib/libbsp/m32r/m32rsim/startup/linkcmds
+++ b/c/src/lib/libbsp/m32r/m32rsim/startup/linkcmds
@@ -78,7 +78,7 @@ SECTIONS
   PROVIDE (__etext = .);
   PROVIDE (_etext = .);
   PROVIDE (etext = .);
-  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+  .rodata         : { *(.rodata .rodata.* KEEP (*(SORT(.rtemsroset.*))) .gnu.linkonce.r.*) }
   .rodata1        : { *(.rodata1) }
   .tdata : {
     _TLS_Data_begin = .;
@@ -168,6 +168,7 @@ SECTIONS
   .data           :
   {
     *(.data .data.* .gnu.linkonce.d.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     SORT(CONSTRUCTORS)
   }
   .data1          : { *(.data1) }
diff --git a/c/src/lib/libbsp/m68k/av5282/startup/linkcmds b/c/src/lib/libbsp/m68k/av5282/startup/linkcmds
index c72601d..01ba1c5 100644
--- a/c/src/lib/libbsp/m68k/av5282/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/av5282/startup/linkcmds
@@ -123,6 +123,7 @@ SECTIONS
         . = ALIGN (16);
         _rodata_start = . ;
         *(.rodata*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
         
         . = ALIGN (16);
@@ -157,6 +158,7 @@ SECTIONS
             PROVIDE( _data_dest_start = . );
             PROVIDE( _copy_start = .);
             *(.data*)
+            KEEP (*(SORT(.rtemsrwset.*)))
             *(.gnu.linkonce.d*)
             *(.gcc_except_table*)
             *(.jcr)
diff --git a/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsflash b/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsflash
index 3d361df..45841ff 100644
--- a/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsflash
+++ b/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsflash
@@ -122,6 +122,7 @@ SECTIONS
         . = ALIGN (16);
         _rodata_start = . ;
         *(.rodata*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
         
         . = ALIGN (16);
@@ -157,6 +158,7 @@ SECTIONS
             PROVIDE( _data_dest_start = . );
             PROVIDE( _copy_start = .);
             *(.data)
+            KEEP (*(SORT(.rtemsrwset.*)))
             *(.gnu.linkonce.d*)
             *(.gcc_except_table*)
             *(.jcr)
diff --git a/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsram b/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsram
index 4c11cc7..c93ba85 100644
--- a/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsram
+++ b/c/src/lib/libbsp/m68k/av5282/startup/linkcmdsram
@@ -122,6 +122,7 @@ SECTIONS
         . = ALIGN (16);
         _rodata_start = . ;
         *(.rodata*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
         
         . = ALIGN (16);
@@ -156,6 +157,7 @@ SECTIONS
             PROVIDE( _data_dest_start = . );
             PROVIDE( _copy_start = .);
             *(.data)
+            KEEP (*(SORT(.rtemsrwset.*)))
             *(.gnu.linkonce.d*)
             *(.gcc_except_table*)
             *(.jcr)
diff --git a/c/src/lib/libbsp/m68k/csb360/startup/linkcmds b/c/src/lib/libbsp/m68k/csb360/startup/linkcmds
index 9b1c2d5..e06ccc3 100644
--- a/c/src/lib/libbsp/m68k/csb360/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/csb360/startup/linkcmds
@@ -95,6 +95,7 @@ SECTIONS
 	. = ALIGN (16);
 	_rodata_start = .;
 	*(.rodata*)
+        KEEP (*(SORT(.rtemsroset.*)))
 	*(.gnu.linkonce.r*)
 
 	. = ALIGN (16);
@@ -128,6 +129,7 @@ SECTIONS
         *(.shdata)
         . = ALIGN (0x10);
         *(.data*)
+        KEEP (*(SORT(.rtemsrwset.*)))
         . = ALIGN (0x10);
         *(.gcc_exc)
         *(.gcc_except_table*)
diff --git a/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds b/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds
index d831f7a..34f42b9 100644
--- a/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/gen68302/startup/linkcmds
@@ -109,6 +109,7 @@ SECTIONS
 		. = ALIGN (16);
 		_rodata_start = . ;
 		*(.rodata*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.gnu.linkonce.r*)
 
                  . = ALIGN (16);
@@ -137,6 +138,7 @@ SECTIONS
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
+                KEEP (*(SORT(.rtemsrwset.*)))
 		*(.gnu.linkonce.d*)
 		*(.gcc_except_table*)
 		*(.jcr)
diff --git a/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds b/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds
index bde2809..5f95ed3 100644
--- a/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/gen68340/startup/linkcmds
@@ -137,6 +137,7 @@ SECTIONS {
 		. = ALIGN (16);
 		_rodata_start = . ;
 		*(.rodata*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.gnu.linkonce.r*)
 
                  . = ALIGN (16);
@@ -165,6 +166,7 @@ SECTIONS {
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
+                KEEP (*(SORT(.rtemsrwset.*)))
 		*(.gnu.linkonce.d*)
 		*(.gcc_except_table*)
 		*(.jcr)
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds
index 7957b04..fbdf14b 100644
--- a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds
@@ -101,6 +101,7 @@ SECTIONS {
 		. = ALIGN (16);
 		_rodata_start = . ;
 		*(.rodata*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.gnu.linkonce.r*)
 
                  . = ALIGN (16);
@@ -129,6 +130,7 @@ SECTIONS {
         .data : {
                 _copy_start = .;
                 *(.data*)
+                KEEP (*(SORT(.rtemsrwset.*)))
 		*(.gnu.linkonce.d*)
 		*(.gcc_except_table*)
 		*(.jcr)
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp
index d14ed8f..ccd08a1 100644
--- a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp
+++ b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp
@@ -106,6 +106,7 @@ SECTIONS {
 		. = ALIGN (16);
 		_rodata_start = . ;
 		*(.rodata*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.gnu.linkonce.r*)
 
                  . = ALIGN (16);
@@ -134,6 +135,7 @@ SECTIONS {
         .data : AT(SIZEOF(.text)) {
                 _copy_start = .;
                 *(.data)
+                KEEP (*(SORT(.rtemsrwset.*)))
 		*(.gnu.linkonce.d*)
 		*(.jcr)
 		*(.gcc_except_table*)
diff --git a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom
index 22637bf..777700e 100644
--- a/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom
+++ b/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom
@@ -105,6 +105,7 @@ SECTIONS {
 		. = ALIGN (16);
 		_rodata_start = . ;
 		*(.rodata*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.gnu.linkonce.r*)
 
                  . = ALIGN (16);
@@ -133,6 +134,7 @@ SECTIONS {
         .data : AT(SIZEOF(.text)) {
                 _copy_start = .;
                 *(.data)
+                KEEP (*(SORT(.rtemsrwset.*)))
 		*(.gnu.linkonce.d*)
 		*(.jcr)
 		*(.gcc_except_table*)
diff --git a/c/src/lib/libbsp/m68k/idp/startup/linkcmds b/c/src/lib/libbsp/m68k/idp/startup/linkcmds
index a8efe63..8f4b037 100644
--- a/c/src/lib/libbsp/m68k/idp/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/idp/startup/linkcmds
@@ -106,6 +106,7 @@ SECTIONS
 		. = ALIGN (16);
 		_rodata_start = .;
 		*(.rodata*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.gnu.linkonce.r*)
 
                  . = ALIGN (16);
@@ -134,6 +135,7 @@ SECTIONS
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
+                KEEP (*(SORT(.rtemsrwset.*)))
 		*(.gnu.linkonce.d*)
 		*(.gcc_except_table*)
 		*(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds b/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds
index d7ceb20..22b5268 100644
--- a/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds
@@ -130,6 +130,7 @@ SECTIONS
 	   . = ALIGN (16);
 	   _rodata_start = .;
 	   *(.rodata*)
+           KEEP (*(SORT(.rtemsroset.*)))
 	   *(.gnu.linkonce.r*)
 
 	   . = ALIGN (16);
@@ -161,6 +162,7 @@ SECTIONS
            *(.shdata)
            . = ALIGN (0x10);
            *(.data*)
+           KEEP (*(SORT(.rtemsrwset.*)))
            . = ALIGN (0x10);
            *(.gcc_exc)
            *(.gcc_except_table*)
diff --git a/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds.flash b/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds.flash
index 12db0e2..57c1daf 100644
--- a/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds.flash
+++ b/c/src/lib/libbsp/m68k/mcf5206elite/startup/linkcmds.flash
@@ -130,6 +130,7 @@ SECTIONS
 	   . = ALIGN (16);
 	   _rodata_start = . ;
 	   *(.rodata)
+           KEEP (*(SORT(.rtemsroset.*)))
 	   *(.gnu.linkonce.r*)
 
            . = ALIGN (16);
@@ -162,6 +163,7 @@ SECTIONS
            *(.shdata)
            . = ALIGN (0x10);
            *(.data)
+           KEEP (*(SORT(.rtemsrwset.*)))
            . = ALIGN (0x10);
            *(.gcc_exc)
            *(.gcc_except_table*)
diff --git a/c/src/lib/libbsp/m68k/mcf52235/startup/linkcmds b/c/src/lib/libbsp/m68k/mcf52235/startup/linkcmds
index e10a57f..8b0981b 100644
--- a/c/src/lib/libbsp/m68k/mcf52235/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mcf52235/startup/linkcmds
@@ -110,6 +110,7 @@ SECTIONS
         . = ALIGN (16);
         _rodata_start = . ;
         *(.rodata*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
 
         . = ALIGN (16);
@@ -146,6 +147,7 @@ SECTIONS
         PROVIDE( _copy_start = .);
         *(.data)
         *(.data.*)
+        KEEP (*(SORT(.rtemsrwset.*)))
         *(.gnu.linkonce.d*)
         *(.gcc_except_table*)
         *(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds b/c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds
index b0a48b7..42f0857 100644
--- a/c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mcf5225x/startup/linkcmds
@@ -110,6 +110,7 @@ SECTIONS
         . = ALIGN (16);
         _rodata_start = . ;
         *(.rodata*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
 
         . = ALIGN (16);
@@ -145,6 +146,7 @@ SECTIONS
         PROVIDE( _data_dest_start = . );
         PROVIDE( _copy_start = .);
         *(.data*)
+        KEEP (*(SORT(.rtemsrwset.*)))
         *(.gnu.linkonce.d*)
         *(.gcc_except_table*)
         *(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmds b/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmds
index 1fa3bef..0aa079a 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmds
@@ -130,6 +130,7 @@ SECTIONS
         . = ALIGN (16);
         _rodata_start = . ;
         *(.rodata*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
         
         . = ALIGN (16);
@@ -164,6 +165,7 @@ SECTIONS
             PROVIDE( _data_dest_start = . );
             PROVIDE( _copy_start = .);
             *(.data*)
+            KEEP (*(SORT(.rtemsrwset.*)))
             *(.gnu.linkonce.d*)
             *(.gcc_except_table*)
             *(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsflash b/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsflash
index 8082860..6a724a9 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsflash
+++ b/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsflash
@@ -134,6 +134,7 @@ SECTIONS
         . = ALIGN (16);
         _rodata_start = . ;
         *(.rodata*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
         
         . = ALIGN (16);
@@ -169,6 +170,7 @@ SECTIONS
             PROVIDE( _data_dest_start = . );
             PROVIDE( _copy_start = .);
             *(.data)
+            KEEP (*(SORT(.rtemsrwset.*)))
             *(.gnu.linkonce.d*)
             *(.gcc_except_table*)
             *(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsram b/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsram
index d960364..06a62e1 100644
--- a/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsram
+++ b/c/src/lib/libbsp/m68k/mcf5235/startup/linkcmdsram
@@ -130,6 +130,7 @@ SECTIONS
         . = ALIGN (16);
         _rodata_start = . ;
         *(.rodata*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
         
         . = ALIGN (16);
@@ -164,6 +165,7 @@ SECTIONS
             PROVIDE( _data_dest_start = . );
             PROVIDE( _copy_start = .);
             *(.data)
+            KEEP (*(SORT(.rtemsrwset.*)))
             *(.gnu.linkonce.d*)
             *(.gcc_except_table*)
             *(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmds b/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmds
index b5a228e..3426f21 100644
--- a/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmds
@@ -121,6 +121,7 @@ SECTIONS
         . = ALIGN (16);
         _rodata_start = . ;
         *(.rodata*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
 
         . = ALIGN (16);
@@ -156,6 +157,7 @@ SECTIONS
         PROVIDE( _data_dest_start = . );
         PROVIDE( _copy_start = .);
         *(.data*)
+        KEEP (*(SORT(.rtemsrwset.*)))
         *(.gnu.linkonce.d*)
         *(.gcc_except_table*)
         *(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmdsflash b/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmdsflash
index 30f4687..c1e081d 100644
--- a/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmdsflash
+++ b/c/src/lib/libbsp/m68k/mcf5329/startup/linkcmdsflash
@@ -117,6 +117,7 @@ SECTIONS
         . = ALIGN (16);
         _rodata_start = . ;
         *(.rodata*)
+        KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
 
         . = ALIGN (16);
@@ -152,6 +153,7 @@ SECTIONS
         PROVIDE( _data_dest_start = . );
         PROVIDE( _copy_start = .);
         *(.data*)
+        KEEP (*(SORT(.rtemsrwset.*)))
         *(.gnu.linkonce.d*)
         *(.gcc_except_table*)
         *(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds b/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds
index aeed9a3..3640c51 100644
--- a/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds
@@ -137,6 +137,7 @@ SECTIONS
     . = ALIGN (16);
     _rodata_start = . ;
     *(.rodata*)
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.gnu.linkonce.r*)
 
     . = ALIGN (16);
@@ -169,6 +170,7 @@ SECTIONS
   {
 	PROVIDE (_copy_start = .);
     *(.data*)
+        KEEP (*(SORT(.rtemsrwset.*)))
 	*(.gnu.linkonce.d*)
 	*(.gcc_except_table*)
 	*(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds
index ad4cba6..85d614d 100644
--- a/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mvme136/startup/linkcmds
@@ -106,6 +106,7 @@ SECTIONS
 		. = ALIGN (16);
 		_rodata_start = .;
 		*(.rodata*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.gnu.linkonce.r*)
 
                  . = ALIGN (16);
@@ -134,6 +135,7 @@ SECTIONS
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
+                KEEP (*(SORT(.rtemsrwset.*)))
 		*(.gnu.linkonce.d*)
 		*(.gcc_except_table*)
 		*(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds
index bc75072..fcbd073 100644
--- a/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mvme147/startup/linkcmds
@@ -110,6 +110,7 @@ SECTIONS
 		. = ALIGN (16);
 		_rodata_start = .;
 		*(.rodata*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.gnu.linkonce.r*)
 
                  . = ALIGN (16);
@@ -138,6 +139,7 @@ SECTIONS
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
+                KEEP (*(SORT(.rtemsrwset.*)))
 		*(.gnu.linkonce.d*)
 		*(.gcc_except_table*)
 		*(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds
index e8ac4c5..fbc8527 100644
--- a/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds
@@ -110,6 +110,7 @@ SECTIONS
 		. = ALIGN (16);
 		_rodata_start = .;
 		*(.rodata*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.gnu.linkonce.r*)
 
                  . = ALIGN (16);
@@ -138,6 +139,7 @@ SECTIONS
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
+                KEEP (*(SORT(.rtemsrwset.*)))
 		*(.gnu.linkonce.d*)
 		*(.gcc_except_table*)
 		*(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds
index 10a5c1d..1368d05 100644
--- a/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mvme162/startup/linkcmds
@@ -113,6 +113,7 @@ SECTIONS
 		. = ALIGN (16);
 		_rodata_start = .;
 		*(.rodata*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.gnu.linkonce.r*)
 
                  . = ALIGN (16);
@@ -141,6 +142,7 @@ SECTIONS
         .data : {
                 PROVIDE (_copy_start = .);
                 *(.data*)
+                KEEP (*(SORT(.rtemsrwset.*)))
 		*(.gnu.linkonce.d*)
 		*(.gcc_except_table*)
 		*(.jcr)
diff --git a/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds
index d585bf9..b10b29d 100644
--- a/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mvme167/startup/linkcmds
@@ -119,6 +119,7 @@ SECTIONS
     . = ALIGN (16);
     _rodata_start = .;
     *(.rodata*)
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.gnu.linkonce.r*)
     PROVIDE(_erodata = . );
 
@@ -148,6 +149,7 @@ SECTIONS
   .data : {
     PROVIDE (_copy_start = .);
     *(.data*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)
     *(.gcc_except_table*)
     *(.jcr)
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/debugger b/c/src/lib/libbsp/m68k/ods68302/startup/debugger
index 8d156bd..62fd5bc 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/debugger
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/debugger
@@ -50,6 +50,8 @@ SECTIONS
   {
     data_start = .;
     *(.data)
+    KEEP (*(SORT(.rtemsroset.*)))
+    KEEP (*(SORT(.rtemsrwset.*)))
     edata = .;
   }
   .bss (ADDR(.data) + SIZEOF(.data)) :
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds b/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds
index c153825..39bdee0 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds
@@ -122,6 +122,7 @@ SECTIONS
 		. = ALIGN (16);
 		_rodata_start = .;
 		*(.rodata*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.gnu.linkonce.r*)
 
                  . = ALIGN (16);
@@ -152,6 +153,7 @@ SECTIONS
           AT (ADDR(.tdata) + SIZEOF(.tdata)) {
                 PROVIDE (_copy_start = .);
                 *(.data*)
+                KEEP (*(SORT(.rtemsrwset.*)))
 		*(.gnu.linkonce.d*)
 		*(.gcc_except_table*)
 		*(.jcr)
diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/rom b/c/src/lib/libbsp/m68k/ods68302/startup/rom
index 352ae6a..4b0e810 100644
--- a/c/src/lib/libbsp/m68k/ods68302/startup/rom
+++ b/c/src/lib/libbsp/m68k/ods68302/startup/rom
@@ -52,6 +52,8 @@ SECTIONS
   {
     data_start = .;
     *(.data)
+    KEEP (*(SORT(.rtemsroset.*)))
+    KEEP (*(SORT(.rtemsrwset.*)))
     edata = .;
   }
   .bss (ADDR(.data) + SIZEOF(.data)) :
diff --git a/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds b/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds
index dbf9081..56905fc 100644
--- a/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds
@@ -138,6 +138,7 @@ SECTIONS
         . = ALIGN (16);
         _rodata_start = . ;
         *(.rodata*)
+	KEEP (*(SORT(.rtemsroset.*)))
         *(.gnu.linkonce.r*)
 
         . = ALIGN (16);
@@ -172,6 +173,7 @@ SECTIONS
         PROVIDE( _data_dest_start = . );
         PROVIDE( _copy_start = .);
         *(.data*)
+        KEEP (*(SORT(.rtemsrwset.*)))
         *(.gnu.linkonce.d*)
         *(.gcc_except_table*)
         *(.jcr)
diff --git a/c/src/lib/libbsp/mips/csb350/startup/linkcmds b/c/src/lib/libbsp/mips/csb350/startup/linkcmds
index 47234fe..384cd5b 100644
--- a/c/src/lib/libbsp/mips/csb350/startup/linkcmds
+++ b/c/src/lib/libbsp/mips/csb350/startup/linkcmds
@@ -111,6 +111,7 @@ SECTIONS
     *(.rdata)
     *(.rodata)
     *(.rodata.*)
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.gnu.linkonce.r*)
   } >ram  
 
@@ -139,6 +140,7 @@ SECTIONS
 
     *(.data)
     *(.data.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)
   } >ram  
 
diff --git a/c/src/lib/libbsp/mips/genmongoosev/startup/linkcmds b/c/src/lib/libbsp/mips/genmongoosev/startup/linkcmds
index c0da8b7..e396379 100644
--- a/c/src/lib/libbsp/mips/genmongoosev/startup/linkcmds
+++ b/c/src/lib/libbsp/mips/genmongoosev/startup/linkcmds
@@ -108,6 +108,7 @@ SECTIONS
     *(.rdata)
     *(.rodata)
     *(.rodata.*)
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.gnu.linkonce.r*)
   } >ram  
 
@@ -136,6 +137,7 @@ SECTIONS
 
     *(.data)
     *(.data.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)
   } >ram  
 
diff --git a/c/src/lib/libbsp/mips/hurricane/startup/linkcmds b/c/src/lib/libbsp/mips/hurricane/startup/linkcmds
index f261248..2706d81 100644
--- a/c/src/lib/libbsp/mips/hurricane/startup/linkcmds
+++ b/c/src/lib/libbsp/mips/hurricane/startup/linkcmds
@@ -97,6 +97,7 @@ SECTIONS
     *(.rdata)
     *(.rodata)
     *(.rodata.*)
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.gnu.linkonce.r*)
   }
 
@@ -124,6 +125,7 @@ SECTIONS
   .data : {
     *(.data)
     *(.data.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)
     SORT(CONSTRUCTORS)
   }
diff --git a/c/src/lib/libbsp/mips/rbtx4925/startup/linkcmds b/c/src/lib/libbsp/mips/rbtx4925/startup/linkcmds
index 3c08ce4..d7039ab 100644
--- a/c/src/lib/libbsp/mips/rbtx4925/startup/linkcmds
+++ b/c/src/lib/libbsp/mips/rbtx4925/startup/linkcmds
@@ -97,6 +97,7 @@ SECTIONS
     *(.rdata)
     *(.rodata)
     *(.rodata.*)
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.gnu.linkonce.r*)
   }
 
@@ -124,6 +125,7 @@ SECTIONS
   .data : {
     *(.data)
     *(.data.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)
     SORT(CONSTRUCTORS)
   }
diff --git a/c/src/lib/libbsp/mips/rbtx4938/startup/linkcmds b/c/src/lib/libbsp/mips/rbtx4938/startup/linkcmds
index af99da5..a0f4c41 100644
--- a/c/src/lib/libbsp/mips/rbtx4938/startup/linkcmds
+++ b/c/src/lib/libbsp/mips/rbtx4938/startup/linkcmds
@@ -97,6 +97,7 @@ SECTIONS
     *(.rdata)
     *(.rodata)
     *(.rodata.*)
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.gnu.linkonce.r*)
   }
 
@@ -124,6 +125,7 @@ SECTIONS
   .data : {
     *(.data)
     *(.data.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)
     SORT(CONSTRUCTORS)
   }
diff --git a/c/src/lib/libbsp/moxie/moxiesim/startup/linkcmds b/c/src/lib/libbsp/moxie/moxiesim/startup/linkcmds
index 15be77d..e1e489c 100644
--- a/c/src/lib/libbsp/moxie/moxiesim/startup/linkcmds
+++ b/c/src/lib/libbsp/moxie/moxiesim/startup/linkcmds
@@ -130,7 +130,7 @@ SECTIONS
   {
     KEEP (*(.fini))
   } =0
-  .rodata   : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) }
+  .rodata   : { *(.rodata) *(.rodata.*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) }
   .rodata1   : { *(.rodata1) }
   .tdata : {
     _TLS_Data_begin = .;
@@ -156,6 +156,7 @@ SECTIONS
   {
     *(.data)
     *(.data.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)
     SORT(CONSTRUCTORS)
   }
diff --git a/c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds b/c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds
index 74e5485..662d097 100644
--- a/c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds
+++ b/c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds
@@ -193,7 +193,7 @@ SECTIONS
     {
         PROVIDE (__ram_rodata_start = ABSOLUTE(.));
         . = ALIGN(32 / 8);
-        *(.rodata .rodata.* .gnu.linkonce.r.*)
+        *(.rodata .rodata.* KEEP (*(SORT(.rtemsroset.*))) .gnu.linkonce.r.*)
         *(.rodata1)
     } > onchip_memory_0
 
@@ -227,6 +227,7 @@ SECTIONS
         *(.got.plt) *(.got)
         *(.data1)
         *(.data .data.* .gnu.linkonce.d.*)
+        KEEP (*(SORT(.rtemsrwset.*)))
 
         _gp = ABSOLUTE(. + 0x8000);
         PROVIDE(gp = _gp);
diff --git a/c/src/lib/libbsp/powerpc/beatnik/startup/linkcmds b/c/src/lib/libbsp/powerpc/beatnik/startup/linkcmds
index ae3fe06..84cbc97f 100644
--- a/c/src/lib/libbsp/powerpc/beatnik/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/beatnik/startup/linkcmds
@@ -93,7 +93,7 @@ SECTIONS
   }  > CODE
 
   .fini			  : { _fini = .; *(.fini)	} >CODE
-  .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) }	> CODE
+  .rodata         : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) }	> CODE
   .rodata1        : { *(.rodata1) }	> CODE
   .tdata : {
     _TLS_Data_begin = .;
@@ -142,6 +142,7 @@ SECTIONS
   {
 	PROVIDE(__DATA_START__ = ABSOLUTE(.) );
     *(.data)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)	
     CONSTRUCTORS
   } > CODE
diff --git a/c/src/lib/libbsp/powerpc/ep1a/startup/linkcmds b/c/src/lib/libbsp/powerpc/ep1a/startup/linkcmds
index 775374c..69644e3 100644
--- a/c/src/lib/libbsp/powerpc/ep1a/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/ep1a/startup/linkcmds
@@ -62,7 +62,7 @@ SECTIONS
   } =0
   .init		  : { _init = .; *(.init)	}
   .fini		  : { _fini = .; *(.fini)	}
-  .rodata  	  : { *(.rodata*) *(.gnu.linkonce.r*) }
+  .rodata  	  : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) }
   .rodata1	  : { *(.rodata1) }
   .tdata : {
     _TLS_Data_begin = .;
@@ -109,6 +109,7 @@ SECTIONS
   {
     PROVIDE(__DATA_START__ = ABSOLUTE(.) );
     *(.data)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d.*)
     CONSTRUCTORS
   }
diff --git a/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds.base b/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds.base
index 4c186ef..4ded908 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds.base
+++ b/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds.base
@@ -87,6 +87,7 @@ SECTIONS {
 		 * BSP: Moved into .text from .*
 		 */
 		*(.rodata .rodata.* .gnu.linkonce.r.*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.rodata1)
 		*(.interp)
 		*(.note.gnu.build-id)
@@ -223,6 +224,7 @@ SECTIONS {
 		PROVIDE_HIDDEN (__fini_array_end = .);
 
 		*(.data .data.* .gnu.linkonce.d.*)
+		KEEP (*(SORT(.rtemsrwset.*)))
 		KEEP (*(.gnu.linkonce.d.*personality*))
 		SORT(CONSTRUCTORS)
 
diff --git a/c/src/lib/libbsp/powerpc/haleakala/startup/linkcmds b/c/src/lib/libbsp/powerpc/haleakala/startup/linkcmds
index fc8f68e..bed8580 100644
--- a/c/src/lib/libbsp/powerpc/haleakala/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/haleakala/startup/linkcmds
@@ -37,6 +37,7 @@ SECTIONS
      *(.text*)
      *(.rodata*)
      *(.rodata1)
+     KEEP (*(SORT(.rtemsroset.*)))
 
      /*
       * Special FreeBSD sysctl sections.
@@ -208,6 +209,7 @@ SECTIONS
       data.start = .;
       *(.data)
       *(.data1)
+      KEEP (*(SORT(.rtemsrwset.*)))
       *(.data.* .gnu.linkonce.d.*)
       data.end = .;
     } > RAM
diff --git a/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds b/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds
index 45332bc..537e4db 100644
--- a/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds
@@ -125,6 +125,7 @@ SECTIONS
     *(.shdata)
     *(.rodata*)
     *(.rodata1)
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.descriptors)
     *(rom_ver)
     _erodata = .;
@@ -207,6 +208,7 @@ SECTIONS
     
     *(.data)
     *(.data.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.data1)
     
     PROVIDE (__EXCEPT_START__ = .);
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/startup/linkcmds b/c/src/lib/libbsp/powerpc/mpc8260ads/startup/linkcmds
index fc14155..de52e46 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/startup/linkcmds
@@ -125,6 +125,7 @@ SECTIONS
     *(.shdata)
     *(.rodata)
     *(.rodata1)
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.descriptors)
     *(rom_ver)
     _erodata = .;
@@ -269,6 +270,7 @@ SECTIONS
       *(.data)
       *(.data1)
       *(.data.* .gnu.linkonce.d.*)
+      KEEP (*(SORT(.rtemsrwset.*)))
       PROVIDE (__SDATA_START__ = .);
       *(.sdata .sdata.* .gnu.linkonce.s.*)
       data.end = .;
diff --git a/c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds b/c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds
index 4af6976..6e1e877 100644
--- a/c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/qemuppc/startup/linkcmds
@@ -95,7 +95,7 @@ SECTIONS
 
   .rodata :
   {
-    *(.rodata .rodata.* .gnu.linkonce.r.*)
+    *(.rodata .rodata.* KEEP (*(SORT(.rtemsroset.*))) .gnu.linkonce.r.*)
     *(.rodata1)
     . = ALIGN (bsp_section_align);
     __rodata_end = .;
@@ -127,6 +127,7 @@ SECTIONS
   {
     __data_start = .;
     *(.data .data.* .gnu.linkonce.d.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     KEEP (*(.gnu.linkonce.d.*personality*))
     SORT(CONSTRUCTORS)
     *(.data1)
diff --git a/c/src/lib/libbsp/powerpc/score603e/startup/linkcmds b/c/src/lib/libbsp/powerpc/score603e/startup/linkcmds
index 46b5e38..7006557 100644
--- a/c/src/lib/libbsp/powerpc/score603e/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/score603e/startup/linkcmds
@@ -101,7 +101,7 @@ SECTIONS
   }  >RAM
   .init		  : { _init = .; __init = .; *(.init)		} >RAM
   .fini		  : { _fini = .; __fini = .; *(.fini)		} >RAM
-  .rodata  	  : { *(.rodata*) *(.gnu.linkonce.r*) } >RAM
+  .rodata  	  : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) } >RAM
   .rodata1	  : { *(.rodata1)		} >RAM
   .tdata : {
     _TLS_Data_begin = .;
@@ -146,6 +146,7 @@ SECTIONS
   {
    *(.data)
     *(.data.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d.*)
     CONSTRUCTORS
   } >RAM
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/linkcmds b/c/src/lib/libbsp/powerpc/shared/startup/linkcmds
index 34969e1..d0d22a7 100644
--- a/c/src/lib/libbsp/powerpc/shared/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/shared/startup/linkcmds
@@ -77,7 +77,7 @@ SECTIONS
 
   .fini		  : { _fini = .; KEEP(*(.fini))	} > CODE
 
-  .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) }	> CODE
+  .rodata         : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) }	> CODE
   .rodata1        : { *(.rodata1) }	> CODE
 
   .tdata : {
@@ -157,6 +157,7 @@ SECTIONS
     */
 	PROVIDE(__DATA_START__ = ABSOLUTE(.) );
     *(.data .data.* .gnu.linkonce.d*)	
+    KEEP (*(SORT(.rtemsrwset.*)))
     SORT(CONSTRUCTORS)
   } > CODE
   .data1   : { *(.data1) }	> CODE
diff --git a/c/src/lib/libbsp/powerpc/ss555/startup/linkcmds b/c/src/lib/libbsp/powerpc/ss555/startup/linkcmds
index 809b9a3..ebc9e81 100644
--- a/c/src/lib/libbsp/powerpc/ss555/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/ss555/startup/linkcmds
@@ -121,6 +121,7 @@ SECTIONS
     *(.shdata)
     *(.rodata*)
     *(.rodata1)
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.descriptors)
     *(rom_ver)
     _erodata = .;
@@ -171,6 +172,7 @@ SECTIONS
     
     *(.data)
     *(.data.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.data1)
     
     PROVIDE (__SDATA_START__ = .);
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/startup/linkcmds.base b/c/src/lib/libbsp/powerpc/tqm8xx/startup/linkcmds.base
index 979989f..fd1ba71 100644
--- a/c/src/lib/libbsp/powerpc/tqm8xx/startup/linkcmds.base
+++ b/c/src/lib/libbsp/powerpc/tqm8xx/startup/linkcmds.base
@@ -78,7 +78,7 @@ SECTIONS {
 		/*
 		 * BSP: Moved into .text from .*
 		 */
-		*(.rodata .rodata.* .gnu.linkonce.r.*)
+		*(.rodata .rodata.* KEEP (*(SORT(.rtemsroset.*))) .gnu.linkonce.r.*)
 		*(.rodata1)
 		*(.interp)
 		*(.note.gnu.build-id)
@@ -218,6 +218,7 @@ SECTIONS {
 		PROVIDE_HIDDEN (__fini_array_end = .);
 
 		*(.data .data.* .gnu.linkonce.d.*)
+		KEEP (*(SORT(.rtemsrwset.*)))
 		KEEP (*(.gnu.linkonce.d.*personality*))
 		SORT(CONSTRUCTORS)
 
diff --git a/c/src/lib/libbsp/powerpc/virtex4/startup/linkcmds b/c/src/lib/libbsp/powerpc/virtex4/startup/linkcmds
index 55b8f88..a22ee3f 100644
--- a/c/src/lib/libbsp/powerpc/virtex4/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/virtex4/startup/linkcmds
@@ -91,7 +91,7 @@ SECTIONS
                     } > RAM
 
   /* Miscellaneous read-only data */
-  .rodata         : { *(.rodata.* .gnu.linkonce.r*)                    } > RAM
+  .rodata         : { *(.rodata.* KEEP (*(SORT(.rtemsroset.*))) .gnu.linkonce.r*) } > RAM
   .rodata1        : { *(.rodata1)                                      } > RAM
 
   .tdata : {
@@ -139,6 +139,7 @@ SECTIONS
   .data           : { PROVIDE(__DATA_START__ = ABSOLUTE(.) );
                       *(.data)
                       *(.data.*)
+                      KEEP (*(SORT(.rtemsrwset.*)))
                       *(.gnu.linkonce.d*)
                     } > RAM
 
diff --git a/c/src/lib/libbsp/powerpc/virtex5/startup/linkcmds b/c/src/lib/libbsp/powerpc/virtex5/startup/linkcmds
index 63d187c..ce88a43 100644
--- a/c/src/lib/libbsp/powerpc/virtex5/startup/linkcmds
+++ b/c/src/lib/libbsp/powerpc/virtex5/startup/linkcmds
@@ -91,7 +91,7 @@ SECTIONS
                     } > RAM
 
   /* Miscellaneous read-only data */
-  .rodata         : { *(.rodata.* .gnu.linkonce.r*)                    } > RAM
+  .rodata         : { *(.rodata.* KEEP (*(SORT(.rtemsroset.*))) .gnu.linkonce.r*) } > RAM
   .rodata1        : { *(.rodata1)                                      } > RAM
 
   .tdata : {
@@ -139,6 +139,7 @@ SECTIONS
   .data           : { PROVIDE(__DATA_START__ = ABSOLUTE(.) );
                       *(.data)
                       *(.data.*)
+                      KEEP (*(SORT(.rtemsrwset.*)))
                       *(.gnu.linkonce.d*)
                     } > RAM
 
diff --git a/c/src/lib/libbsp/sh/gensh1/startup/linkcmds b/c/src/lib/libbsp/sh/gensh1/startup/linkcmds
index 80a241c..d5945b3 100644
--- a/c/src/lib/libbsp/sh/gensh1/startup/linkcmds
+++ b/c/src/lib/libbsp/sh/gensh1/startup/linkcmds
@@ -131,7 +131,7 @@ SECTIONS
   .fini    .  : { KEEP(*(.fini))    } > ram =0
   .ctors   .  : { KEEP(*(.ctors))    } > ram =0
   .dtors   .  : { KEEP(*(.dtors))    } > ram =0
-  .rodata  .  : { *(.rodata*) *(.gnu.linkonce.r*) } > ram
+  .rodata  .  : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) } > ram
   .rodata1 .  : { *(.rodata1) } > ram
   .tdata : {
     __TLS_Data_begin = .;
@@ -155,6 +155,7 @@ SECTIONS
   .data  .  :
   {
     *(.data*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gcc_exc*)
     ___EH_FRAME_BEGIN__ = .;
     *(.eh_fram*)
diff --git a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
index e9f73f9..d58f25e 100644
--- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
+++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds
@@ -142,7 +142,7 @@ SECTIONS
   .fini    .  : { KEEP(*(.fini))    } > ram =0
   .ctors   .  : { KEEP(*(.ctors))    } > ram =0
   .dtors   .  : { KEEP(*(.dtors))    } > ram =0
-  .rodata  .  : { *(.rodata*) *(.gnu.linkonce.r*) } > ram
+  .rodata  .  : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) } > ram
   .rodata1 .  : { *(.rodata1) } > ram
   .tdata : {
     __TLS_Data_begin = .;
@@ -166,6 +166,7 @@ SECTIONS
   .data  .  :
   {
     *(.data*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gcc_exc*)
     ___EH_FRAME_BEGIN__ = .;
     *(.eh_fram*)
diff --git a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram
index c962e8f..d744907 100644
--- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram
+++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.ram
@@ -139,7 +139,7 @@ SECTIONS
   _etext = .;
   PROVIDE (etext = .);
   .fini    .  : { *(.fini)    } > ram =0
-  .rodata  .  : { *(.rodata) *(.gnu.linkonce.r*) } > ram
+  .rodata  .  : { *(.rodata) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) } > ram
   .rodata1 .  : { *(.rodata1) } > ram
   .tdata : {
     __TLS_Data_begin = .;
@@ -163,6 +163,7 @@ SECTIONS
   .data  .  :
   {
     *(.data)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)
     CONSTRUCTORS
   } > ram
diff --git a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom
index 321760a..c59613b 100644
--- a/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom
+++ b/c/src/lib/libbsp/sh/gensh2/startup/linkcmds.rom
@@ -140,7 +140,7 @@ SECTIONS
   _etext = .;
   PROVIDE (etext = .);
   .fini    .  : { *(.fini)    } > ram =0
-  .rodata  .  : { *(.rodata) *(.gnu.linkonce.r*) } > ram
+  .rodata  .  : { *(.rodata) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) } > ram
   .rodata1 .  : { *(.rodata1) } > ram
   .tdata : {
     __TLS_Data_begin = .;
@@ -164,6 +164,7 @@ SECTIONS
   .data  .  :
   {
     *(.data)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)
     CONSTRUCTORS
   } > ram
diff --git a/c/src/lib/libbsp/sh/gensh4/startup/linkcmds b/c/src/lib/libbsp/sh/gensh4/startup/linkcmds
index 7ddb95d..40b764e 100644
--- a/c/src/lib/libbsp/sh/gensh4/startup/linkcmds
+++ b/c/src/lib/libbsp/sh/gensh4/startup/linkcmds
@@ -87,6 +87,7 @@ SECTIONS
   { 
     *(.rodata) 
     *(.rodata.*) 
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.gnu.linkonce.r*) 
   } > ram
   .tdata : {
@@ -113,6 +114,7 @@ SECTIONS
   {
     copy_start = .;
     *(.data*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gcc_exc*)
     ___EH_FRAME_BEGIN__ = .;
     *(.eh_fram*)
diff --git a/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom b/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom
index a84b502..ee61498 100644
--- a/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom
+++ b/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom
@@ -102,6 +102,7 @@ SECTIONS
   { 
     *(.rodata) 
     *(.rodata.*) 
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.gnu.linkonce.r*) 
     . = ALIGN(32);
   } > rom
@@ -162,6 +163,7 @@ SECTIONS
     copy_start = .;
     *(.data)
     *(.data.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)
     SORT(CONSTRUCTORS)
     copy_end = .;
diff --git a/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom2ram b/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom2ram
index 30c315e..6565624 100644
--- a/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom2ram
+++ b/c/src/lib/libbsp/sh/gensh4/startup/linkcmds.rom2ram
@@ -89,6 +89,7 @@ SECTIONS
   { 
     *(.rodata) 
     *(.rodata.*) 
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.gnu.linkonce.r*) 
     . = ALIGN(32);
   } > ram
@@ -147,6 +148,7 @@ SECTIONS
   {
     *(.data)
     *(.data.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)
     SORT(CONSTRUCTORS)
     copy_end = .;
diff --git a/c/src/lib/libbsp/sh/shsim/startup/linkcmds.sim b/c/src/lib/libbsp/sh/shsim/startup/linkcmds.sim
index 5b0d4d7..c9f9ad5 100644
--- a/c/src/lib/libbsp/sh/shsim/startup/linkcmds.sim
+++ b/c/src/lib/libbsp/sh/shsim/startup/linkcmds.sim
@@ -121,7 +121,7 @@ SECTIONS
   } =0
   _etext = .;
   PROVIDE (etext = .);
-  .rodata  .  : { *(.rodata*) .rodata.* *(.gnu.linkonce.r*) } > ram
+  .rodata  .  : { *(.rodata*) .rodata.* KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) } > ram
   .rodata1 .  : { *(.rodata1) } > ram
   .tdata : {
     __TLS_Data_begin = .;
@@ -145,6 +145,7 @@ SECTIONS
   .data  .  :
   {
     *(.data*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gcc_exc*)
     ___EH_FRAME_BEGIN__ = .;
     *(.eh_fram*)
diff --git a/c/src/lib/libbsp/sparc64/shared/startup/linkcmds b/c/src/lib/libbsp/sparc64/shared/startup/linkcmds
index 95c8913..24e0a01 100644
--- a/c/src/lib/libbsp/sparc64/shared/startup/linkcmds
+++ b/c/src/lib/libbsp/sparc64/shared/startup/linkcmds
@@ -138,6 +138,7 @@ SECTIONS
 
     _rodata_start = . ;
     *(.rodata*)
+    KEEP (*(SORT(.rtemsroset.*)))
     *(.gnu.linkonce.r*)
     _erodata = ALIGN( 0x10 ) ;
 
@@ -173,6 +174,7 @@ SECTIONS
     _data_start = . ;
     *(.data)
     *(.data*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.rodata)  /* We need to include .rodata here if gcc is used */
     *(.rodata*) /* with -fdata-sections.  */
     *(.gnu.linkonce.d*)
diff --git a/c/src/lib/libbsp/v850/gdbv850sim/startup/linkcmds b/c/src/lib/libbsp/v850/gdbv850sim/startup/linkcmds
index fe0f22b..ff7bb85 100644
--- a/c/src/lib/libbsp/v850/gdbv850sim/startup/linkcmds
+++ b/c/src/lib/libbsp/v850/gdbv850sim/startup/linkcmds
@@ -89,7 +89,7 @@ SECTIONS
     *(.call_table_text)
   }
   .fini		: { KEEP (*(.fini)) } =0
-  .rodata	: { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) }
+  .rodata	: { *(.rodata .rodata.* KEEP (*(SORT(.rtemsroset.*))) .gnu.linkonce.r.*) }
   .rodata1	: { *(.rodata1) }
   .tdata : {
     __TLS_Data_begin = .;
@@ -111,6 +111,7 @@ SECTIONS
   {
     *(.data)
     *(.data.*)
+    KEEP (*(SORT(.rtemsrwset.*)))
     *(.gnu.linkonce.d*)
     CONSTRUCTORS
   }
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index fb93b98..c90f4a2 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -17,6 +17,7 @@ include_sys_HEADERS += include/sys/timex.h
 include_rtemsdir = $(includedir)/rtems
 
 include_rtems_HEADERS =
+include_rtems_HEADERS += include/rtems/linkersets.h
 include_rtems_HEADERS += include/rtems/system.h
 include_rtems_HEADERS += include/rtems/seterr.h
 
diff --git a/cpukit/score/include/rtems/linkersets.h b/cpukit/score/include/rtems/linkersets.h
new file mode 100644
index 0000000..e40be66
--- /dev/null
+++ b/cpukit/score/include/rtems/linkersets.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef _RTEMS_LINKERSET_H
+#define _RTEMS_LINKERSET_H
+
+#include <rtems/score/basedefs.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define RTEMS_LINKER_SET_BEGIN( set ) \
+  _Linker_set_##set##_begin
+
+#define RTEMS_LINKER_SET_END( set ) \
+  _Linker_set_##set##_end
+
+#define RTEMS_LINKER_SET_SIZE( set ) \
+  ( (size_t) ( _Linker_set_##set##_end - _Linker_set_##set##_begin ) )
+
+#define RTEMS_LINKER_ROSET_DECLARE( set, type ) \
+  extern type volatile const RTEMS_LINKER_SET_BEGIN( set )[0]; \
+  extern type volatile const RTEMS_LINKER_SET_END( set )[0]
+
+#define RTEMS_LINKER_ROSET( set, type ) \
+  type volatile const RTEMS_LINKER_SET_BEGIN( set )[0] \
+  RTEMS_SECTION( ".rtemsroset." #set ".begin" ) RTEMS_USED; \
+  type volatile const RTEMS_LINKER_SET_END( set )[0] \
+  RTEMS_SECTION( ".rtemsroset." #set ".end" ) RTEMS_USED
+
+#define RTEMS_LINKER_ROSET_ITEM_DECLARE( set, type, item ) \
+  extern type volatile const _Linker_set_##set##_##item
+
+#define RTEMS_LINKER_ROSET_ITEM_REFERENCE( set, type, item ) \
+  static type volatile const * const _Set_reference_##set##_##item \
+  RTEMS_SECTION( ".rtemsroset.reference" ) RTEMS_USED = \
+  &_Linker_set_##set##_##item
+
+#define RTEMS_LINKER_ROSET_ITEM_ORDERED( set, type, item, order ) \
+  type volatile const _Linker_set_##set##_##item \
+  RTEMS_SECTION( ".rtemsroset." #set ".content.0." RTEMS_XSTRING( order ) ) \
+  RTEMS_USED
+
+#define RTEMS_LINKER_ROSET_ITEM( set, type, item ) \
+  type volatile const _Linker_set_##set##_##item \
+  RTEMS_SECTION( ".rtemsroset." #set ".content.1" ) RTEMS_USED
+
+#define RTEMS_LINKER_RWSET_DECLARE( set, type ) \
+  extern type volatile RTEMS_LINKER_SET_BEGIN( set )[0]; \
+  extern type volatile RTEMS_LINKER_SET_END( set )[0]
+
+#define RTEMS_LINKER_RWSET( set, type ) \
+  type volatile RTEMS_LINKER_SET_BEGIN( set )[0] \
+  RTEMS_SECTION( ".rtemsrwset." #set ".begin" ) RTEMS_USED; \
+  type volatile RTEMS_LINKER_SET_END( set )[0] \
+  RTEMS_SECTION( ".rtemsrwset." #set ".end" ) RTEMS_USED
+
+#define RTEMS_LINKER_RWSET_ITEM_DECLARE( set, type, item ) \
+  extern type volatile _Linker_set_##set##_##item
+
+/*
+ * The .rtemsroset is here not a typo.  We must ensure that the references are
+ * not a victim of the garbage collection of the linker.  Thus, we place them
+ * in a dedicated area of the RTEMS read-only linker set section.
+ */
+#define RTEMS_LINKER_RWSET_ITEM_REFERENCE( set, type, item ) \
+  static type volatile * const _Set_reference_##set##_##item \
+  RTEMS_SECTION( ".rtemsroset.reference" ) RTEMS_USED = \
+  &_Linker_set_##set##_##item
+
+#define RTEMS_LINKER_RWSET_ITEM_ORDERED( set, type, item, order ) \
+  type volatile _Linker_set_##set##_##item \
+  RTEMS_SECTION( ".rtemsrwset." #set ".content.0." RTEMS_XSTRING( order ) ) \
+  RTEMS_USED
+
+#define RTEMS_LINKER_RWSET_ITEM( set, type, item ) \
+  type volatile _Linker_set_##set##_##item \
+  RTEMS_SECTION( ".rtemsrwset." #set ".content.1" ) RTEMS_USED
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _RTEMS_LINKERSET_H */
diff --git a/cpukit/score/preinstall.am b/cpukit/score/preinstall.am
index 4b96109..4a45e87 100644
--- a/cpukit/score/preinstall.am
+++ b/cpukit/score/preinstall.am
@@ -43,6 +43,10 @@ $(PROJECT_INCLUDE)/rtems/$(dirstamp):
 	@: > $(PROJECT_INCLUDE)/rtems/$(dirstamp)
 PREINSTALL_DIRS += $(PROJECT_INCLUDE)/rtems/$(dirstamp)
 
+$(PROJECT_INCLUDE)/rtems/linkersets.h: include/rtems/linkersets.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/linkersets.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/linkersets.h
+
 $(PROJECT_INCLUDE)/rtems/system.h: include/rtems/system.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/system.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/system.h
diff --git a/doc/user/Makefile.am b/doc/user/Makefile.am
index f17179e..ef9fdfd 100644
--- a/doc/user/Makefile.am
+++ b/doc/user/Makefile.am
@@ -15,7 +15,7 @@ GENERATED_FILES = overview.texi concepts.texi datatypes.texi init.texi \
     signal.texi part.texi region.texi dpmem.texi io.texi fatal.texi \
     schedule.texi rtmon.texi barrier.texi bsp.texi userext.texi conf.texi \
     mp.texi stackchk.texi cpuuse.texi object.texi chains.texi rbtree.texi \
-    timespec.texi cbs.texi dirstat.texi smp.texi libpci.texi
+    timespec.texi cbs.texi dirstat.texi smp.texi libpci.texi linkersets.texi
 
 COMMON_FILES += $(top_srcdir)/common/cpright.texi
 
@@ -211,12 +211,17 @@ cbs.texi: cbs.t
 dirstat.texi: dirstat.t
 	$(BMENU2) -p "Constant Bandwidth Server Scheduler API CBS_GET_APPROVED_BUDGET - Get scheduler approved execution time" \
 	    -u "Top" \
+	    -n "Linker Sets" < $< > $@
+
+linkersets.texi: linkersets.t
+	$(BMENU2) -p "Directive Status Codes STATUS_TEXT - Returns the enumeration name for a status code" \
+	    -u "Top" \
 	    -n "Example Application" < $< > $@
 
 EXTRA_DIST = bsp.t cbs.t clock.t chains.t concepts.t cpuuse.t datatypes.t conf.t \
     dpmem.t event.t fatal.t init.t intr.t io.t mp.t msg.t overview.t \
     part.t rbtree.t region.t rtmon.t sem.t schedule.t signal.t stackchk.t \
     task.t timer.t userext.t dirstat.t $(TXT_FILES) $(PNG_FILES) $(EPS_IMAGES) \
-    $(noinst_DATA)
+    $(noinst_DATA) linkersets.t
 
 CLEANFILES += c_user.info c_user.info-? c_user.info-??
diff --git a/doc/user/c_user.texi b/doc/user/c_user.texi
index ebbdec9..cc69358 100644
--- a/doc/user/c_user.texi
+++ b/doc/user/c_user.texi
@@ -116,6 +116,7 @@
 * Timespec Helpers::
 * Constant Bandwidth Server Scheduler API::
 * Directive Status Codes::
+* Linker Sets::
 * Example Application::
 * Glossary::
 * Command and Variable Index::
@@ -162,6 +163,7 @@
 @include timespec.texi
 @include cbs.texi
 @include dirstat.texi
+ at include linkersets.texi
 @include example.texi
 @include glossary.texi
 
diff --git a/doc/user/example.texi b/doc/user/example.texi
index 157247e..d6f24b9 100644
--- a/doc/user/example.texi
+++ b/doc/user/example.texi
@@ -3,7 +3,7 @@
 @c  On-Line Applications Research Corporation (OAR).
 @c  All rights reserved.
 
- at node Example Application, Glossary, Directive Status Codes STATUS_TEXT - Returns the enumeration name for a status code, Top
+ at node Example Application, Glossary, Linker Sets RTEMS_LINKER_RWSET_ITEM_ORDERED - Defines an ordered read-write linker set item, Top
 @chapter Example Application
 
 @example
diff --git a/doc/user/linkersets.t b/doc/user/linkersets.t
new file mode 100644
index 0000000..9d1abda
--- /dev/null
+++ b/doc/user/linkersets.t
@@ -0,0 +1,421 @@
+ at c
+ at c Copyright 2015 embedded brains GmbH
+ at c All rights reserved.
+
+ at chapter Linker Sets
+
+ at cindex linkersets
+
+ at section Introduction
+
+Linker sets are a flexible means to create arrays of items out of a set of
+object files at link-time.  For example its possible to define an item @emph{I}
+of type @emph{T} in object file @emph{A} and an item @emph{J} of type @emph{T}
+in object file @emph{B} to be a member of a linker set @emph{S}.  The linker
+will then collect these two items @emph{I} and @emph{J} and place them in
+consecutive memory locations, so that they can be accessed like a normal array
+defined in one object file.  The size of a linker set is defined by its begin
+and end markers.  A linker set may be empty.  It should only contain items of
+the same type.
+
+The following macros are provided to create, populate and use linker sets.
+
+ at itemize @bullet
+ at item @code{RTEMS_LINKER_SET_BEGIN} - Designator of the linker set begin marker
+ at item @code{RTEMS_LINKER_SET_END} - Designator of the linker set end marker
+ at item @code{RTEMS_LINKER_SET_SIZE} - The linker set size in characters
+ at item @code{RTEMS_LINKER_ROSET_DECLARE} - Declares a read-only linker set
+ at item @code{RTEMS_LINKER_ROSET} - Defines a read-only linker set
+ at item @code{RTEMS_LINKER_ROSET_ITEM_DECLARE} - Declares a read-only linker set item
+ at item @code{RTEMS_LINKER_ROSET_ITEM_REFERENCE} - References a read-only linker set item
+ at item @code{RTEMS_LINKER_ROSET_ITEM} - Defines a read-only linker set item
+ at item @code{RTEMS_LINKER_ROSET_ITEM_ORDERED} - Defines an ordered read-only linker set item
+ at item @code{RTEMS_LINKER_RWSET_DECLARE} - Declares a read-write linker set
+ at item @code{RTEMS_LINKER_RWSET} - Defines a read-write linker set
+ at item @code{RTEMS_LINKER_RWSET_ITEM_DECLARE} - Declares a read-write linker set item
+ at item @code{RTEMS_LINKER_RWSET_ITEM_REFERENCE} - References a read-write linker set item
+ at item @code{RTEMS_LINKER_RWSET_ITEM} - Defines a read-write linker set item
+ at item @code{RTEMS_LINKER_RWSET_ITEM_ORDERED} - Defines an ordered read-write linker set item
+ at end itemize
+
+ at section Background
+
+Linker sets are used not only in RTEMS, but also for example in Linux, in
+FreeBSD, for the GNU C constructor extension and for global C++ constructors.
+They provide a space efficient and flexible means to initialize modules.  A
+linker set consists of
+ at itemize @bullet
+ at item dedicated input sections for the linker (e.g. @code{.ctors} and
+ at code{.ctors.*} in the case of global constructors),
+ at item a begin marker (e.g. provided by @code{crtbegin.o}, and
+ at item an end marker (e.g. provided by @code{ctrend.o}).
+ at end itemize
+A module may place a certain data item into the dedicated input section.  The
+linker will collect all such data items in this section and creates a begin and
+end marker.  The initialization code can then use the begin and end markers to
+find all the collected data items (e.g. pointers to initialization functions).
+
+In the linker command file of the GNU linker we need the following output
+section descriptions.
+ at example
+ at group
+/* To be placed in a read-only memory region */
+.rtemsroset : @{
+  KEEP (*(SORT(.rtemsroset.*)))
+@}
+
+/* To be placed in a read-write memory region */
+.rtemsrwset : @{
+  KEEP (*(SORT(.rtemsrwset.*)))
+@}
+ at end group
+ at end example
+The @code{KEEP()} ensures that a garbage collection by the linker will not
+discard the content of this section.  This would normally be the case since the
+linker set items are not referenced directly.  The @code{SORT()} directive
+sorts the input sections lexicographically.  Please note the lexicographical
+order of the @code{.begin}, @code{.content} and @code{.end} section name parts
+in the RTEMS linker sets macros which ensures that the position of the begin
+and end markers are right.
+
+So, what is the benefit of using linker sets to initialize modules?  It can be
+used to initialize and include only those RTEMS managers and other components
+which are used by the application.  For example, in case an application uses
+message queues, it must call @code{rtems_message_queue_create()}.  In the
+module implementing this function, we can place a linker set item and register
+the message queue handler constructor.  Otherwise, in case the application does
+not use message queues, there will be no reference to the
+ at code{rtems_message_queue_create()} function and the constructor is not
+registered, thus nothing of the message queue handler will be in the final
+executable.
+
+For an example see test program @file{sptests/splinkersets01}.
+
+ at section Directives
+
+ at macro linkersetsset
+The @code{set} parameter itself must be a valid C designator on which no macro
+expansion is performed.  It uniquely identifies the linker set.
+ at end macro
+
+ at macro linkersetstype
+The @code{type} parameter defines the type of the linker set items.  The type
+must be the same for all macro invocations of a particular linker set.
+ at end macro
+
+ at macro linkersetsitem
+The @code{item} parameter itself must be a valid C designator on which no macro
+expansion is performed.  It uniquely identifies an item in the linker set.
+ at end macro
+
+ at macro linkersetsorder
+The @code{order} parameter must be a valid linker input section name part on
+which macro expansion is performed.  The items are lexicographically ordered
+according to the @code{order} parameter within a linker set.  Ordered items are
+placed before unordered items in the linker set.
+ at end macro
+
+ at page
+
+ at subsection RTEMS_LINKER_SET_BEGIN - Designator of the linker set begin marker
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_SET_BEGIN
+ at example
+volatile type *begin = RTEMS_LINKER_SET_BEGIN( set );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates the designator of the begin marker of the linker set
+identified by @code{set}.  The item at the begin marker address is the first
+member of the linker set if it exists, e.g. the linker set is not empty.  A
+linker set is empty, if and only if the begin and end markers have the same
+address.
+ at linkersetsset
+
+ at page
+
+ at subsection RTEMS_LINKER_SET_END - Designator of the linker set end marker
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_SET_END
+ at example
+volatile type *end = RTEMS_LINKER_SET_END( set );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates the designator of the end marker of the linker set
+identified by @code{set}.  The item at the end marker address is not a member
+of the linker set.  @linkersetsset
+
+ at page
+
+ at subsection RTEMS_LINKER_SET_SIZE - The linker set size in characters
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_SET_SIZE
+ at example
+size_t size = RTEMS_LINKER_SET_SIZE( set );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro returns the size of the linker set identified by @code{set} in
+characters.  @linkersetsset
+
+ at page
+
+ at subsection RTEMS_LINKER_ROSET_DECLARE - Declares a read-only linker set
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_ROSET_DECLARE
+ at example
+RTEMS_LINKER_ROSET_DECLARE( set, type );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates declarations for the begin and end markers of a read-only
+linker set identified by @code{set}.  @linkersetsset @linkersetstype
+
+ at page
+
+ at subsection RTEMS_LINKER_ROSET - Defines a read-only linker set
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_ROSET
+ at example
+RTEMS_LINKER_ROSET( set, type );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates definitions for the begin and end markers of a read-only
+linker set identified by @code{set}.  @linkersetsset @linkersetstype
+
+ at page
+
+ at subsection RTEMS_LINKER_ROSET_ITEM_DECLARE - Declares a read-only linker set item
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_ROSET_ITEM_DECLARE
+ at example
+RTEMS_LINKER_ROSET_ITEM_DECLARE( set, type, item );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates a declaration of an item contained in the read-only linker
+set identified by @code{set}.  @linkersetsset @linkersetstype @linkersetsitem
+
+ at page
+
+ at subsection RTEMS_LINKER_ROSET_ITEM_REFERENCE - References a read-only linker set item
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_ROSET_ITEM_REFERENCE
+ at example
+RTEMS_LINKER_ROSET_ITEM_REFERENCE( set, type, item );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates a reference to an item contained in the read-only linker set
+identified by @code{set}.  @linkersetsset @linkersetstype @linkersetsitem
+
+ at page
+
+ at subsection RTEMS_LINKER_ROSET_ITEM - Defines a read-only linker set item
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_ROSET_ITEM
+ at example
+RTEMS_LINKER_ROSET_ITEM( set, type, item );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates a definition of an item contained in the read-only linker set
+identified by @code{set}.  @linkersetsset @linkersetstype @linkersetsitem
+
+ at page
+
+ at subsection RTEMS_LINKER_ROSET_ITEM_ORDERED - Defines an ordered read-only linker set item
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_ROSET_ITEM_ORDERED
+ at example
+RTEMS_LINKER_ROSET_ITEM_ORDERED( set, type, item, order );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates a definition of an ordered item contained in the read-only
+linker set identified by @code{set}.  @linkersetsset @linkersetstype
+ at linkersetsitem @linkersetsorder
+
+ at subheading NOTES:
+
+To be resilient to typos in the order parameter, it is recommended to use the
+following construct in macros defining items for a particular linker set (see
+enum in @code{XYZ_ITEM()}).
+
+ at example
+#include <rtems/linkersets.h>
+
+typedef struct @{
+  int foo;
+@} xyz_item;
+
+/* The XYZ-order defines */
+#define XYZ_ORDER_FIRST 0x00001000
+#define XYZ_ORDER_AND_SO_ON 0x00002000
+
+/* Defines an ordered XYZ-item */
+#define XYZ_ITEM( item, order ) \
+  enum @{ xyz_##item = order - order @}; \
+  RTEMS_LINKER_ROSET_ITEM_ORDERED( \
+    xyz, const xyz_item *, item, order \
+  ) = @{ &item @}
+
+/* Example item */
+static const xyz_item some_item = @{ 123 @};
+XYZ_ITEM( some_item, XYZ_ORDER_FIRST );
+ at end example
+
+ at page
+
+ at subsection RTEMS_LINKER_RWSET_DECLARE - Declares a read-write linker set
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_RWSET_DECLARE
+ at example
+RTEMS_LINKER_RWSET_DECLARE( set, type );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates declarations for the begin and end markers of a read-write
+linker set identified by @code{set}.  @linkersetsset @linkersetstype
+
+ at page
+
+ at subsection RTEMS_LINKER_RWSET - Defines a read-write linker set
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_RWSET
+ at example
+RTEMS_LINKER_RWSET( set, type );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates definitions for the begin and end markers of a read-write
+linker set identified by @code{set}.  @linkersetsset @linkersetstype
+
+ at page
+
+ at subsection RTEMS_LINKER_RWSET_ITEM_DECLARE - Declares a read-write linker set item
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_RWSET_ITEM_DECLARE
+ at example
+RTEMS_LINKER_RWSET_ITEM_DECLARE( set, type, item );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates a declaration of an item contained in the read-write linker
+set identified by @code{set}.  @linkersetsset @linkersetstype @linkersetsitem
+
+ at page
+
+ at subsection RTEMS_LINKER_RWSET_ITEM_REFERENCE - References a read-write linker set item
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_RWSET_ITEM_REFERENCE
+ at example
+RTEMS_LINKER_RWSET_ITEM_REFERENCE( set, type, item );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates a reference to an item contained in the read-write linker set
+identified by @code{set}.  @linkersetsset @linkersetstype @linkersetsitem
+
+ at page
+
+ at subsection RTEMS_LINKER_RWSET_ITEM - Defines a read-write linker set item
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_RWSET_ITEM
+ at example
+RTEMS_LINKER_RWSET_ITEM( set, type, item );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates a definition of an item contained in the read-write linker set
+identified by @code{set}.  @linkersetsset @linkersetstype @linkersetsitem
+
+ at page
+
+ at subsection RTEMS_LINKER_RWSET_ITEM_ORDERED - Defines an ordered read-write linker set item
+
+ at subheading CALLING SEQUENCE:
+
+ at findex RTEMS_LINKER_RWSET_ITEM_ORDERED
+ at example
+RTEMS_LINKER_RWSET_ITEM_ORDERED( set, type, item, order );
+ at end example
+
+ at subheading DESCRIPTION:
+
+This macro generates a definition of an ordered item contained in the read-write
+linker set identified by @code{set}.  @linkersetsset @linkersetstype
+ at linkersetsitem @linkersetsorder
+
+ at subheading NOTES:
+
+To be resilient to typos in the order parameter, it is recommended to use the
+following construct in macros defining items for a particular linker set (see
+enum in @code{XYZ_ITEM()}).
+
+ at example
+#include <rtems/linkersets.h>
+
+typedef struct @{
+  int foo;
+@} xyz_item;
+
+/* The XYZ-order defines */
+#define XYZ_ORDER_FIRST 0x00001000
+#define XYZ_ORDER_AND_SO_ON 0x00002000
+
+/* Defines an ordered XYZ-item */
+#define XYZ_ITEM( item, order ) \
+  enum @{ xyz_##item = order - order @}; \
+  RTEMS_LINKER_RWSET_ITEM_ORDERED( \
+    xyz, const xyz_item *, item, order \
+  ) = @{ &item @}
+
+/* Example item */
+static const xyz_item some_item = @{ 123 @};
+XYZ_ITEM( some_item, XYZ_ORDER_FIRST );
+ at end example
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 54b8555..32ce1da 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -43,6 +43,7 @@ endif
 if HAS_THREADS_H
 _SUBDIRS += spstdthreads01
 endif
+_SUBDIRS += splinkersets01
 _SUBDIRS += sptasknopreempt01
 _SUBDIRS += spintrcritical23
 _SUBDIRS += sptimecounter01
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index e6c51b4..2f50ceb 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -46,6 +46,7 @@ AM_CONDITIONAL(HAS_SMP,test "$rtems_cv_RTEMS_SMP" = "yes")
 
 # Explicitly list all Makefiles here
 AC_CONFIG_FILES([Makefile
+splinkersets01/Makefile
 spstdthreads01/Makefile
 spsyslock01/Makefile
 sptasknopreempt01/Makefile
diff --git a/testsuites/sptests/splinkersets01/Makefile.am b/testsuites/sptests/splinkersets01/Makefile.am
new file mode 100644
index 0000000..ad70761
--- /dev/null
+++ b/testsuites/sptests/splinkersets01/Makefile.am
@@ -0,0 +1,23 @@
+rtems_tests_PROGRAMS = splinkersets01
+splinkersets01_SOURCES = init.c
+splinkersets01_DEPENDENCIES = libsplinkersets01.a
+
+noinst_LIBRARIES = libsplinkersets01.a
+libsplinkersets01_a_SOURCES = sets.c items.c
+
+dist_rtems_tests_DATA = splinkersets01.scn splinkersets01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(splinkersets01_OBJECTS)
+LINK_LIBS = $(splinkersets01_LDLIBS) libsplinkersets01.a
+
+splinkersets01$(EXEEXT): $(splinkersets01_OBJECTS) $(splinkersets01_DEPENDENCIES)
+	@rm -f splinkersets01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/splinkersets01/init.c b/testsuites/sptests/splinkersets01/init.c
new file mode 100644
index 0000000..3d35a4e
--- /dev/null
+++ b/testsuites/sptests/splinkersets01/init.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include "tmacros.h"
+
+#include "splinkersets01.h"
+
+const char rtems_test_name[] = "SPLINKERSETS 1";
+
+RTEMS_LINKER_RWSET(test_rw_i, const int *);
+
+RTEMS_LINKER_ROSET(test_ro_i, const int *);
+
+RTEMS_LINKER_RWSET_DECLARE(test_rw_i, const int *);
+
+RTEMS_LINKER_ROSET_DECLARE(test_ro_i, const int *);
+
+const int a[4];
+
+const int ca[5];
+
+RTEMS_LINKER_RWSET_ITEM(test_rw, const int *, a3) = &a[3];
+RTEMS_LINKER_RWSET_ITEM_ORDERED(test_rw, const int *, a2, 2) = &a[2];
+RTEMS_LINKER_RWSET_ITEM_REFERENCE(test_rw, const int *, a1);
+RTEMS_LINKER_RWSET_ITEM_ORDERED(test_rw, const int *, a0, 0) = &a[0];
+
+/* Items are ordered lexicographically */
+RTEMS_LINKER_RWSET_ITEM(test_rw_i, const int *, a3) = &a[3];
+RTEMS_LINKER_RWSET_ITEM_ORDERED(test_rw_i, const int *, a2, 2) = &a[2];
+RTEMS_LINKER_RWSET_ITEM_ORDERED(test_rw_i, const int *, a1, 11) = &a[1];
+RTEMS_LINKER_RWSET_ITEM_ORDERED(test_rw_i, const int *, a0, 0) = &a[0];
+
+#define OZ OA
+
+RTEMS_LINKER_ROSET_ITEM(test_ro, const int *, ca4) = &ca[4];
+RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro, const int *, ca3, OD) = &ca[3];
+RTEMS_LINKER_ROSET_ITEM_REFERENCE(test_ro, const int *, ca2);
+RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro, const int *, ca1, OB) = &ca[1];
+RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro, const int *, ca0, OZ) = &ca[0];
+
+RTEMS_LINKER_ROSET_ITEM(test_ro_i, const int *, ca4) = &ca[4];
+RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro_i, const int *, ca3, OD) = &ca[3];
+RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro_i, const int *, ca2, OC) = &ca[2];
+RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro_i, const int *, ca1, OB) = &ca[1];
+RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro_i, const int *, ca0, OZ) = &ca[0];
+
+/*
+ * Demonstrate safe (= define must exist) order definitions, otherwise typos
+ * are undetected and may lead to an unpredictable order.  See also above OB
+ * vs. OZ.
+ */
+
+#define SAFE_ORDER_A 00000
+#define SAFE_ORDER_B 00001
+#define SAFE_ORDER_C 00002
+
+#define ITEM(i, o) \
+  enum { test_ro_s_##i = o - o }; \
+  RTEMS_LINKER_RWSET_ITEM_ORDERED(test_ro_s, const int *, i, o) = &i
+
+RTEMS_LINKER_RWSET(test_ro_s, const int *);
+
+static const int s0;
+static const int s1;
+static const int s2;
+
+ITEM(s2, SAFE_ORDER_C);
+ITEM(s1, SAFE_ORDER_B);
+ITEM(s0, SAFE_ORDER_A);
+
+static void test(void)
+{
+  const int * volatile *b = RTEMS_LINKER_SET_BEGIN(test_rw);
+  const int * volatile *e = RTEMS_LINKER_SET_END(test_rw);
+  const int * volatile const *cb = RTEMS_LINKER_SET_BEGIN(test_ro);
+  const int * volatile const *ce = RTEMS_LINKER_SET_END(test_ro);
+  const int * volatile *bi = RTEMS_LINKER_SET_BEGIN(test_rw_i);
+  const int * volatile *ei = RTEMS_LINKER_SET_END(test_rw_i);
+  const int * volatile const *cbi = RTEMS_LINKER_SET_BEGIN(test_ro_i);
+  const int * volatile const *cei = RTEMS_LINKER_SET_END(test_ro_i);
+  const int * volatile const *sb = RTEMS_LINKER_SET_BEGIN(test_ro_s);
+  const int * volatile const *se = RTEMS_LINKER_SET_END(test_ro_s);
+  size_t i;
+
+  rtems_test_assert((size_t) (e - b) == RTEMS_ARRAY_SIZE(a));
+  rtems_test_assert((size_t) (ce - cb) == RTEMS_ARRAY_SIZE(ca));
+  rtems_test_assert(RTEMS_LINKER_SET_SIZE(test_rw) == RTEMS_ARRAY_SIZE(a));
+  rtems_test_assert(RTEMS_LINKER_SET_SIZE(test_ro) == RTEMS_ARRAY_SIZE(ca));
+
+  rtems_test_assert((size_t) (ei - bi) == RTEMS_ARRAY_SIZE(a));
+  rtems_test_assert((size_t) (cei - cbi) == RTEMS_ARRAY_SIZE(ca));
+  rtems_test_assert((size_t) (se - sb) == 3);
+  rtems_test_assert(RTEMS_LINKER_SET_SIZE(test_rw_i) == RTEMS_ARRAY_SIZE(a));
+  rtems_test_assert(RTEMS_LINKER_SET_SIZE(test_ro_i) == RTEMS_ARRAY_SIZE(ca));
+  rtems_test_assert(RTEMS_LINKER_SET_SIZE(test_ro_s) == 3);
+
+  for (i = 0; i < RTEMS_ARRAY_SIZE(a); ++i) {
+    rtems_test_assert(&a[i] == b[i]);
+  }
+
+  for (i = 0; i < RTEMS_ARRAY_SIZE(ca); ++i) {
+    rtems_test_assert(&ca[i] == cb[i]);
+  }
+
+  for (i = 0; i < RTEMS_ARRAY_SIZE(a); ++i) {
+    rtems_test_assert(&a[i] == bi[i]);
+  }
+
+  for (i = 0; i < RTEMS_ARRAY_SIZE(ca); ++i) {
+    rtems_test_assert(&ca[i] == cbi[i]);
+  }
+
+  rtems_test_assert(&s0 == sb[0]);
+  rtems_test_assert(&s1 == sb[1]);
+  rtems_test_assert(&s2 == sb[2]);
+}
+
+static void Init(rtems_task_argument arg)
+{
+  TEST_BEGIN();
+
+  test();
+
+  TEST_END();
+  rtems_test_exit(0);
+}
+
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
diff --git a/testsuites/sptests/splinkersets01/items.c b/testsuites/sptests/splinkersets01/items.c
new file mode 100644
index 0000000..7ca6f53
--- /dev/null
+++ b/testsuites/sptests/splinkersets01/items.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include "splinkersets01.h"
+
+RTEMS_LINKER_RWSET_ITEM_ORDERED(test_rw, const int *, a1, 1) = &a[1];
+
+RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro, const int *, ca2, OC) = &ca[2];
diff --git a/testsuites/sptests/splinkersets01/sets.c b/testsuites/sptests/splinkersets01/sets.c
new file mode 100644
index 0000000..0cc1993
--- /dev/null
+++ b/testsuites/sptests/splinkersets01/sets.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include "splinkersets01.h"
+
+RTEMS_LINKER_RWSET(test_rw, const int *);
+
+RTEMS_LINKER_ROSET(test_ro, const int *);
diff --git a/testsuites/sptests/splinkersets01/splinkersets01.doc b/testsuites/sptests/splinkersets01/splinkersets01.doc
new file mode 100644
index 0000000..1dece7f
--- /dev/null
+++ b/testsuites/sptests/splinkersets01/splinkersets01.doc
@@ -0,0 +1,25 @@
+This file describes the directives and concepts tested by this test set.
+
+test set name: splinkersets01
+
+directives:
+
+  - RTEMS_LINKER_SET_BEGIN()
+  - RTEMS_LINKER_SET_END()
+  - RTEMS_LINKER_SET_SIZE()
+  - RTEMS_LINKER_ROSET_DECLARE()
+  - RTEMS_LINKER_ROSET()
+  - RTEMS_LINKER_ROSET_ITEM_DECLARE()
+  - RTEMS_LINKER_ROSET_ITEM_REFERENCE()
+  - RTEMS_LINKER_ROSET_ITEM()
+  - RTEMS_LINKER_ROSET_ITEM_ORDERED()
+  - RTEMS_LINKER_RWSET_DECLARE()
+  - RTEMS_LINKER_RWSET()
+  - RTEMS_LINKER_RWSET_ITEM_DECLARE()
+  - RTEMS_LINKER_RWSET_ITEM_REFERENCE()
+  - RTEMS_LINKER_RWSET_ITEM()
+  - RTEMS_LINKER_RWSET_ITEM_ORDERED()
+
+concepts:
+
+  - Ensure that the RTEMS linker sets work.
diff --git a/testsuites/sptests/splinkersets01/splinkersets01.h b/testsuites/sptests/splinkersets01/splinkersets01.h
new file mode 100644
index 0000000..5da8ec6
--- /dev/null
+++ b/testsuites/sptests/splinkersets01/splinkersets01.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifndef SPLINKERSET01_H
+#define SPLINKERSET01_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <rtems/linkersets.h>
+
+extern const int a[4];
+
+extern const int ca[5];
+
+RTEMS_LINKER_RWSET_DECLARE(test_rw, const int *);
+
+RTEMS_LINKER_ROSET_DECLARE(test_ro, const int *);
+
+RTEMS_LINKER_RWSET_ITEM_DECLARE(test_rw, const int *, a1);
+
+RTEMS_LINKER_ROSET_ITEM_DECLARE(test_ro, const int *, ca2);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* SPLINKERSET01_H */
diff --git a/testsuites/sptests/splinkersets01/splinkersets01.scn b/testsuites/sptests/splinkersets01/splinkersets01.scn
new file mode 100644
index 0000000..36c3cd1
--- /dev/null
+++ b/testsuites/sptests/splinkersets01/splinkersets01.scn
@@ -0,0 +1,2 @@
+*** BEGIN OF TEST SPLINKERSETS 1 ***
+*** END OF TEST SPLINKERSETS 1 ***



More information about the vc mailing list