This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Global variable alignment

Note: This was originally posted on 13th January 2011 at http://forums.arm.com

Hi,

I am working with RealView Compilation Tools v2.1.  I need to align a static global variable on a 16-byte boundary.  In the 'Compiler and Libraries Guide' document, section 3.1.3, the __align(n) keyword is explained.  It is not clear to me if n=16 is allowed for a static global variable.  I have tried it and it appears to be working, but I would like to confirm it.

Best Regards,
  Miguel
Parents
  • Note: This was originally posted on 17th January 2011 at http://forums.arm.com

    For RVCT 2.1 it is only specified to work for alignments of 1,2,4, or 8 - it is unclear what happens for alignments larger than this, although I suspect it is not guaranteed to do anything predictably.

    FYI - in newer tool releases (RVCT4.1) it will work for the following alignments of n:

    • For local variables, n can take the values 1, 2, 4, or 8.
    • For global variables, n can take any value up to 0x80000000 in powers of 2.
Reply
  • Note: This was originally posted on 17th January 2011 at http://forums.arm.com

    For RVCT 2.1 it is only specified to work for alignments of 1,2,4, or 8 - it is unclear what happens for alignments larger than this, although I suspect it is not guaranteed to do anything predictably.

    FYI - in newer tool releases (RVCT4.1) it will work for the following alignments of n:

    • For local variables, n can take the values 1, 2, 4, or 8.
    • For global variables, n can take any value up to 0x80000000 in powers of 2.
Children
No data