EV_COG_AD4050LZ: keep IVT_NAME/blank_checksum symbols in LTO builds

Add a "used" attribute to IVT_NAME/blank_checksum
to fix ARMC6 build with the "-flto" flag. (Error: L6236E: No section matches
selector - no section to be FIRST/LAST. )

This attribute, attached to a function, means that code must be emitted
for the function even if it appears that the function is not referenced.
pull/11874/head
Maciej Bocianski 2019-12-04 09:21:19 +01:00
parent 12261edd2b
commit cf1e1ddd4b
1 changed files with 8 additions and 1 deletions

View File

@ -60,8 +60,10 @@ extern void SramInit(void);
Checksum options
*----------------------------------------------------------------------------*/
#if defined(__ICCARM__)
#if defined( __ICCARM__)
__root
#else
__attribute__((used))
#endif
const uint32_t SECTION_PLACE(blank_checksum[],".checksum") =
{
@ -144,6 +146,11 @@ WEAK_FUNCTION( Root_Clk_Err_Handler )
/*----------------------------------------------------------------------------
Exception / Interrupt Vector table
*----------------------------------------------------------------------------*/
#if defined( __ICCARM__)
__root
#else
__attribute__((used))
#endif
const pFunc SECTION_PLACE(IVT_NAME[104],VECTOR_SECTION) = {
(pFunc) INITIAL_SP, /* Initial Stack Pointer */
ADUCM4050_VECTORS