[PATCH] Add RTEMS linker sets

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Oct 14 10:16:37 UTC 2015


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/sim68000/startup/linkcmds    |   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/score/basedefs.h        |  39 +++++++
 cpukit/score/include/rtems/score/linkerset.h       |  76 ++++++++++++++
 cpukit/score/preinstall.am                         |   4 +
 testsuites/sptests/Makefile.am                     |   1 +
 testsuites/sptests/configure.ac                    |   1 +
 testsuites/sptests/splinkerset01/Makefile.am       |  20 ++++
 testsuites/sptests/splinkerset01/init.c            | 115 +++++++++++++++++++++
 testsuites/sptests/splinkerset01/sets.c            |  23 +++++
 testsuites/sptests/splinkerset01/splinkerset01.doc |  18 ++++
 testsuites/sptests/splinkerset01/splinkerset01.h   |  32 ++++++
 testsuites/sptests/splinkerset01/splinkerset01.scn |   2 +
 82 files changed, 472 insertions(+), 20 deletions(-)
 create mode 100644 cpukit/score/include/rtems/score/linkerset.h
 create mode 100644 testsuites/sptests/splinkerset01/Makefile.am
 create mode 100644 testsuites/sptests/splinkerset01/init.c
 create mode 100644 testsuites/sptests/splinkerset01/sets.c
 create mode 100644 testsuites/sptests/splinkerset01/splinkerset01.doc
 create mode 100644 testsuites/sptests/splinkerset01/splinkerset01.h
 create mode 100644 testsuites/sptests/splinkerset01/splinkerset01.scn

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/sim68000/startup/linkcmds b/c/src/lib/libbsp/m68k/sim68000/startup/linkcmds
index 9a326b3..e31a97c 100644
--- a/c/src/lib/libbsp/m68k/sim68000/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/sim68000/startup/linkcmds
@@ -103,6 +103,7 @@ SECTIONS
 		. = ALIGN (16);
 		_rodata_start = .;
 		*(.rodata*)
+		KEEP (*(SORT(.rtemsroset.*)))
 		*(.gnu.linkonce.r*)
 
                  . = ALIGN (16);
@@ -131,6 +132,7 @@ SECTIONS
         .data 0x80000 : 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/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 f727e60..fcb0f53 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -50,6 +50,7 @@ include_rtems_score_HEADERS += include/rtems/score/isr.h
 include_rtems_score_HEADERS += include/rtems/score/isrlevel.h
 include_rtems_score_HEADERS += include/rtems/score/isrlock.h
 include_rtems_score_HEADERS += include/rtems/score/freechain.h
+include_rtems_score_HEADERS += include/rtems/score/linkerset.h
 include_rtems_score_HEADERS += include/rtems/score/mrsp.h
 include_rtems_score_HEADERS += include/rtems/score/mrspimpl.h
 include_rtems_score_HEADERS += include/rtems/score/object.h
diff --git a/cpukit/score/include/rtems/score/basedefs.h b/cpukit/score/include/rtems/score/basedefs.h
index 695ab8f..ae54975 100644
--- a/cpukit/score/include/rtems/score/basedefs.h
+++ b/cpukit/score/include/rtems/score/basedefs.h
@@ -187,6 +187,25 @@
 #endif
 
 /**
+ * @brief Instructs the compiler to place a specific variable or function in
+ * the specified section.
+ */
+#if defined(__GNUC__)
+  #define RTEMS_SECTION( _section ) __attribute__((__section__(_section)))
+#else
+  #define RTEMS_SECTION( _section )
+#endif
+
+/**
+ * @brief Instructs the compiler that a specific variable or function is used.
+ */
+#if defined(__GNUC__)
+  #define RTEMS_USED __attribute__((__used__))
+#else
+  #define RTEMS_USED
+#endif
+
+/**
  *  Instructs the compiler that a specific variable is deliberately unused.
  *  This can occur when reading volatile device memory or skipping arguments
  *  in a variable argument method.
@@ -316,6 +335,26 @@ extern void RTEMS_DEQUALIFY_types_not_compatible(void);
 #endif /*RTEMS_DEQUALIFY_DEPTHX*/
 #endif /*RTEMS_DEQUALIFY*/
 
+/**
+ * @brief Concatenates x and y without expanding.
+ */
+#define RTEMS_CONCAT(x, y) x ## y
+
+/**
+ * @brief Concatenates expansion of x and expansion of y.
+ */
+#define RTEMS_XCONCAT(x,y) RTEMS_CONCAT(x,y)
+
+/**
+ * @brief Stringifies x and y without expanding.
+ */
+#define RTEMS_STRING(x) #x
+
+/**
+ * @brief Stringifies expansion of x and expansion of y.
+ */
+#define RTEMS_XSTRING(x) RTEMS_STRING(x)
+
 #ifndef ASM
   #ifdef RTEMS_DEPRECATED_TYPES
     typedef bool boolean;
diff --git a/cpukit/score/include/rtems/score/linkerset.h b/cpukit/score/include/rtems/score/linkerset.h
new file mode 100644
index 0000000..9529d64
--- /dev/null
+++ b/cpukit/score/include/rtems/score/linkerset.h
@@ -0,0 +1,76 @@
+/*
+ * 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_SCORE_LINKERSET_H
+#define _RTEMS_SCORE_LINKERSET_H
+
+#include <rtems/score/basedefs.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define RTEMS_LINKER_SET_BEGIN( set ) \
+  _Set_##set##_begin
+
+#define RTEMS_LINKER_SET_END( set ) \
+  _Set_##set##_end
+
+#define RTEMS_LINKER_SET_SIZE( set ) \
+  ( (size_t) ( _Set_##set##_end - _Set_##set##_begin ) )
+
+#define RTEMS_LINKER_ROSET_DEFINE( 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_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_ITEM_ORDERED( set, type, item, order ) \
+  static type const _Set_##set##_##item \
+  RTEMS_SECTION( ".rtemsroset." #set ".content.0." RTEMS_XSTRING( order ) ) \
+  RTEMS_USED
+
+#define RTEMS_LINKER_ROSET_ITEM( set, type, item ) \
+  static type const _Set_##set##_##item \
+  RTEMS_SECTION( ".rtemsroset." #set ".content.1." ) RTEMS_USED
+
+#define RTEMS_LINKER_RWSET_DEFINE( 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_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_ITEM_ORDERED( set, type, item, order ) \
+  static type const _Set_##set##_##item \
+  RTEMS_SECTION( ".rtemsrwset." #set ".content.0." RTEMS_XSTRING( order ) ) \
+  RTEMS_USED
+
+#define RTEMS_LINKER_RWSET_ITEM( set, type, item ) \
+  static type const _Set_##set##_##item \
+  RTEMS_SECTION( ".rtemsrwset." #set ".content.1." ) RTEMS_USED
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _RTEMS_SCORE_LINKERSET_H */
+
diff --git a/cpukit/score/preinstall.am b/cpukit/score/preinstall.am
index 062fe1b..d19afdc 100644
--- a/cpukit/score/preinstall.am
+++ b/cpukit/score/preinstall.am
@@ -172,6 +172,10 @@ $(PROJECT_INCLUDE)/rtems/score/freechain.h: include/rtems/score/freechain.h $(PR
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/freechain.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/freechain.h
 
+$(PROJECT_INCLUDE)/rtems/score/linkerset.h: include/rtems/score/linkerset.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/linkerset.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/linkerset.h
+
 $(PROJECT_INCLUDE)/rtems/score/mrsp.h: include/rtems/score/mrsp.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/mrsp.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/mrsp.h
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 688c66f..5cb046b 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -43,6 +43,7 @@ endif
 if HAS_THREADS_H
 _SUBDIRS += spstdthreads01
 endif
+_SUBDIRS += splinkerset01
 _SUBDIRS += sptasknopreempt01
 _SUBDIRS += spintrcritical23
 _SUBDIRS += sptimecounter01
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index ea96dbf..bd7920d 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
+splinkerset01/Makefile
 spstdthreads01/Makefile
 spsyslock01/Makefile
 sptasknopreempt01/Makefile
diff --git a/testsuites/sptests/splinkerset01/Makefile.am b/testsuites/sptests/splinkerset01/Makefile.am
new file mode 100644
index 0000000..58c753d
--- /dev/null
+++ b/testsuites/sptests/splinkerset01/Makefile.am
@@ -0,0 +1,20 @@
+rtems_tests_PROGRAMS = splinkerset01
+splinkerset01_SOURCES = init.c
+splinkerset01_SOURCES += sets.c
+
+dist_rtems_tests_DATA = splinkerset01.scn splinkerset01.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 = $(splinkerset01_OBJECTS)
+LINK_LIBS = $(splinkerset01_LDLIBS)
+
+splinkerset01$(EXEEXT): $(splinkerset01_OBJECTS) $(splinkerset01_DEPENDENCIES)
+	@rm -f splinkerset01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/sptests/splinkerset01/init.c b/testsuites/sptests/splinkerset01/init.c
new file mode 100644
index 0000000..9e0cf17
--- /dev/null
+++ b/testsuites/sptests/splinkerset01/init.c
@@ -0,0 +1,115 @@
+/*
+ * 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 "splinkerset01.h"
+
+const char rtems_test_name[] = "SPLINKERSET 1";
+
+RTEMS_LINKER_RWSET_DEFINE(test_rw_i, const int *);
+
+RTEMS_LINKER_ROSET_DEFINE(test_ro_i, const int *);
+
+RTEMS_LINKER_RWSET_DECLARE(test_rw_i, const int *);
+
+RTEMS_LINKER_ROSET_DECLARE(test_ro_i, const int *);
+
+static const int a[4];
+
+static const int ca[3];
+
+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_ORDERED(test_rw, const int *, a1, 1) = &a[1];
+RTEMS_LINKER_RWSET_ITEM_ORDERED(test_rw, const int *, a0, 0) = &a[0];
+
+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, 1) = &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 *, ca3) = &ca[2];
+RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro, const int *, ca2, 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 *, ca3) = &ca[2];
+RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro_i, const int *, ca2, OB) = &ca[1];
+RTEMS_LINKER_ROSET_ITEM_ORDERED(test_ro_i, const int *, ca0, OZ) = &ca[0];
+
+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);
+  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(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));
+
+  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]);
+  }
+}
+
+static void Init(rtems_task_argument arg)
+{
+  TEST_BEGIN();
+
+  test();
+
+  TEST_END();
+  rtems_test_exit(0);
+}
+
+#define CONFIGURE_APPLICATION_NEEDS_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/splinkerset01/sets.c b/testsuites/sptests/splinkerset01/sets.c
new file mode 100644
index 0000000..a690f63
--- /dev/null
+++ b/testsuites/sptests/splinkerset01/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 "splinkerset01.h"
+
+RTEMS_LINKER_RWSET_DEFINE(test_rw, const int *);
+
+RTEMS_LINKER_ROSET_DEFINE(test_ro, const int *);
diff --git a/testsuites/sptests/splinkerset01/splinkerset01.doc b/testsuites/sptests/splinkerset01/splinkerset01.doc
new file mode 100644
index 0000000..e4af8cd
--- /dev/null
+++ b/testsuites/sptests/splinkerset01/splinkerset01.doc
@@ -0,0 +1,18 @@
+This file describes the directives and concepts tested by this test set.
+
+test set name: splinkerset01
+
+directives:
+
+  - RTEMS_LINKER_ROSET_DECLARE()
+  - RTEMS_LINKER_ROSET_DEFINE()
+  - RTEMS_LINKER_ROSET_ITEM()
+  - RTEMS_LINKER_ROSET_ITEM_ORDERED()
+  - RTEMS_LINKER_RWSET_DECLARE()
+  - RTEMS_LINKER_RWSET_DEFINE()
+  - RTEMS_LINKER_RWSET_ITEM()
+  - RTEMS_LINKER_RWSET_ITEM_ORDERED()
+
+concepts:
+
+  - Ensure that the RTEMS linker sets work.
diff --git a/testsuites/sptests/splinkerset01/splinkerset01.h b/testsuites/sptests/splinkerset01/splinkerset01.h
new file mode 100644
index 0000000..ac83f29
--- /dev/null
+++ b/testsuites/sptests/splinkerset01/splinkerset01.h
@@ -0,0 +1,32 @@
+/*
+ * 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/score/linkerset.h>
+
+RTEMS_LINKER_RWSET_DECLARE(test_rw, const int *);
+
+RTEMS_LINKER_ROSET_DECLARE(test_ro, const int *);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* SPLINKERSET01_H */
diff --git a/testsuites/sptests/splinkerset01/splinkerset01.scn b/testsuites/sptests/splinkerset01/splinkerset01.scn
new file mode 100644
index 0000000..d71551f
--- /dev/null
+++ b/testsuites/sptests/splinkerset01/splinkerset01.scn
@@ -0,0 +1,2 @@
+*** BEGIN OF TEST SPLINKERSET 1 ***
+*** END OF TEST SPLINKERSET 1 ***
-- 
1.8.4.5



More information about the devel mailing list