#include <stdint.h>
uint32_t VarInSection __attribute__ ( (section (".Var")) );
uint8_t AlignedArray[ 128 ] __attribute__( ( aligned( 128 ) ) );
typedef struct
{
uint8_t Var8a;
uint16_t Var16a __attribute__( ( aligned( 8 ) ) );
uint32_t Text[ 4 ];
} AlignedMember_TypeDef;
AlignedMember_TypeDef AlignedMember;
typedef struct __attribute__( (packed) )
{
uint8_t Var8a;
uint16_t Var16a;
uint32_t Text[ 4 ];
} PackedStruct_TypeDef;
PackedStruct_TypeDef PackedStruct;
typedef struct
{
uint8_t Var8a;
uint16_t Var16a;
uint32_t Text[ 4 ];
} __attribute__( (packed) ) PackedStruct2_TypeDef;
PackedStruct2_TypeDef PackedStruct2;
typedef struct __attribute__( (packed, aligned( 128 ) ) )
{
uint8_t Var8a;
uint16_t Var16a;
uint32_t Text[ 4 ];
} AlignedPackedStruct_TypeDef;
AlignedPackedStruct_TypeDef AlignedPackedStruct;
void Foo( void ) __attribute__ ( (section (".Foo")) );
void Foo( void )
{
VarInSection = 0;
AlignedArray[ 0 ] = 0;
PackedStruct.Text[ 0 ] = 1;
PackedStruct2.Text[ 0 ] = 1;
AlignedMember.Var16a = 0;
AlignedPackedStruct.Text[ 0 ] = 1;
}
// .textrw and .text
__root __ramfunc void ramfunc0(void)
{
}
// No effect : .ramfunc
__root void ramfunc1(void) __attribute__ ( (section(".ramfunc") ) );
__root void ramfunc1(void)
{
ramfunc0();
}
|