pragma section support

Asked by Merlin.Shock

Hello,
i am currently porting a AUTOSAR based Operating System to a ARM based chipset.

Sadly i noticed that GNU ARM does support a basic feature required to implement a AUTOSAR OS for ARM.

AUTOSAR OS requires support of the "#pragma section" feature.

(see: http://www.autosar.org/fileadmin/files/releases/4-2/software-architecture/implementation-integration/standard/AUTOSAR_SWS_MemoryMapping.pdf)

Is it possible that this feature will get implemented in GNU Tools for ARM Embedded Processors aswell?

FYI: the GCC implementation for tricore by HighTec supports this feature. Sadly they only publish source code of old versions of their compiler on their website. However it should be possible to get them to release up-to-date versions of the source code for inspiration, since they still use the GPL.

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#1

Hi Merlin,

I'm not clear on what are your exact requirements. Are you at will to change the code? If yes, you could consider section attributes [1,2]. You can use such attributes both on variable and functions. However it only applies to a given declaration, it doesn't apply to a whole region of code as it seems the pragma section does.

[1] https://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html
[2] https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function-Attributes

Does that fit your needs?

Best regards.

Revision history for this message
Merlin.Shock (smerlin) said :
#2

Yeah, section attributes are part of the workaround i am currently using.
This workaround does not comply with the AUTOSAR Standard.
And there is no workaround possible which would comply with the AUTOSAR Standard without a functionality to specify sections for a region of code.

AUTOSAR also are aware that their memory protection specification features not implemented in all compilers (however many/most? compilers for embedded devices still support those features). see following citation (from the document I linked in my original question):

If any other compiler requires keywords that cannot
be mapped to the mechanisms described in this specification this compiler will not be
supported by AUTOSAR. In this case, the compiler vendor has to adapt its compiler.

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) said :
#3

Hi Merlin,

May I ask you what ARM processor are you targeting?

Best regards,

Thomas

Revision history for this message
Merlin.Shock (smerlin) said :
#4

Cortex M3

Revision history for this message
Joey Ye (jinyun-ye) said :
#5

Merlin, is __attribute__((section("text"))) what you need?

Can you help with this problem?

Provide an answer of your own, or ask Merlin.Shock for more information if necessary.

To post a message you must log in.