From 234d155e879d7ca72fa5dd9d29a8347fa294676e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 25 Nov 2019 10:39:19 +0100 Subject: linkersets: Revert to zero-length arrays This partially reverts commit 7ec08391fee73d7a25855089f4996f3c4f448007. Since the RTEMS_DEFINE_GLOBAL_SYMBOL_IN_SECTION() cannot control the alignment of the symbol it cannot be used to define the begin of a linker set. File scope basic __asm__ statements cannot have operands, so there is no way to specify the desired alignment. --- cpukit/include/rtems/linkersets.h | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/cpukit/include/rtems/linkersets.h b/cpukit/include/rtems/linkersets.h index 4a23d7a696..614670338c 100644 --- a/cpukit/include/rtems/linkersets.h +++ b/cpukit/include/rtems/linkersets.h @@ -32,15 +32,10 @@ extern "C" { extern type const RTEMS_LINKER_SET_END( set )[] #define RTEMS_LINKER_ROSET( set, type ) \ - RTEMS_LINKER_ROSET_DECLARE( set, type ); \ - RTEMS_DEFINE_GLOBAL_SYMBOL_IN_SECTION( \ - RTEMS_LINKER_SET_BEGIN( set ), \ - ".rtemsroset." #set ".begin" \ - ); \ - RTEMS_DEFINE_GLOBAL_SYMBOL_IN_SECTION( \ - RTEMS_LINKER_SET_END( set ), \ - ".rtemsroset." #set ".end" \ - ) + type const RTEMS_LINKER_SET_BEGIN( set )[ 0 ] \ + RTEMS_SECTION( ".rtemsroset." #set ".begin" ) RTEMS_USED; \ + type 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 const _Linker_set_##set##_##item @@ -68,15 +63,10 @@ extern "C" { extern type RTEMS_LINKER_SET_END( set )[] #define RTEMS_LINKER_RWSET( set, type ) \ - RTEMS_LINKER_RWSET_DECLARE( set, type ); \ - RTEMS_DEFINE_GLOBAL_SYMBOL_IN_SECTION( \ - RTEMS_LINKER_SET_BEGIN( set ), \ - ".rtemsrwset." #set ".begin" \ - ); \ - RTEMS_DEFINE_GLOBAL_SYMBOL_IN_SECTION( \ - RTEMS_LINKER_SET_END( set ), \ - ".rtemsrwset." #set ".end" \ - ) + type RTEMS_LINKER_SET_BEGIN( set )[ 0 ] \ + RTEMS_SECTION( ".rtemsrwset." #set ".begin" ) RTEMS_USED; \ + type RTEMS_LINKER_SET_END( set )[ 0 ] \ + RTEMS_SECTION( ".rtemsrwset." #set ".end" ) RTEMS_USED #define RTEMS_LINKER_RWSET_ITEM_DECLARE( set, type, item ) \ extern type _Linker_set_##set##_##item -- cgit v1.2.3