**** Advance Notice ****

This site will be closed on 31 December 2015,

Important Information for users of NXP LPCXpresso

This site is for users of Code Red branded products.

NXP LPCXpresso users should visit the LPCXpresso FAQ's for up-to-date information relevant to that product.

'~PRES8' errors or warning when linking objects with armlink

Due to the "Application Binary Interface (ABI) for the ARM Architecture" (commonly refered to as the EABI or AEABI) object files built with one ARM-targeted toolchain can usually be linked using another toolchain.

One common use for this is where an library of functions for a particular piece of hardware may be provided by the producer of that hardware as a library object, which the end user can then use with their "favorite" toolchain. Thus an object library produced using the Code Red IDE could be used by an end user using the ARM/Keil/RealView tools.

One particular gotcha here though is if the object library contains any code written in assembly code. The AEABI requires that an 8 byte stack alignment should be maintained by code, and the AEABI contains an attribute that should be used to flag that a specific object file does indeed maintain this. The compiler will set this attribute automatically, but the assembler will not.

The GNU linker (ld) used by the Code Red IDE does not currently fault if this attribute is not set in object files, but if such objects are found by the ARM/Keil/RealView linker (armlink), then this will generate either a warning or an error as detailed in this ARM Technical Support FAQ entry.

To fix this, you can set the appropriate attribute in your gnu assembler source file by placing the following directive directly before the .section directive at the start of your code:

    .eabi_attribute Tag_ABI_align8_preserved,1

(which is the equivalent of the armasm PRESERVE8 directive).

Preserve8 (last edited 2010-10-07 14:28:11 by CrSupportAb)