component PSA: keep SVCHandler_main/tfm_pendsv_do_schedule symbol in LTO builds

Add a "used" attribute to SVCHandler_main/tfm_pendsv_do_schedule to fix ARMC6 build with
the "-flto" flag.

This attribute, attached to a function/variable, 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 14:04:30 +01:00
parent e3b8514a91
commit 57ac6c83d6
2 changed files with 4 additions and 2 deletions

View File

@ -27,6 +27,7 @@
#include "region_defs.h" #include "region_defs.h"
#include "tfm_nspm.h" #include "tfm_nspm.h"
#include "tfm_memory_utils.h" #include "tfm_memory_utils.h"
#include "platform/mbed_toolchain.h"
/* /*
* IPC partitions. * IPC partitions.
@ -580,7 +581,7 @@ void tfm_spm_init(void)
tfm_thrd_start_scheduler(&this_thrd); tfm_thrd_start_scheduler(&this_thrd);
} }
void tfm_pendsv_do_schedule(struct tfm_state_context_ext *ctxb) MBED_USED void tfm_pendsv_do_schedule(struct tfm_state_context_ext *ctxb)
{ {
#if TFM_LVL == 2 #if TFM_LVL == 2
struct spm_partition_desc_t *p_next_partition; struct spm_partition_desc_t *p_next_partition;

View File

@ -19,6 +19,7 @@
#include <stdbool.h> #include <stdbool.h>
#include "tfm_svcalls.h" #include "tfm_svcalls.h"
#endif #endif
#include "platform/mbed_toolchain.h"
/* This SVC handler is called when a secure partition requests access to a /* This SVC handler is called when a secure partition requests access to a
* buffer area * buffer area
@ -135,7 +136,7 @@ __attribute__((naked)) void SVC_Handler(void)
#error "Unsupported ARM Architecture." #error "Unsupported ARM Architecture."
#endif #endif
uint32_t SVCHandler_main(uint32_t *svc_args, uint32_t lr) MBED_USED uint32_t SVCHandler_main(uint32_t *svc_args, uint32_t lr)
{ {
uint8_t svc_number; uint8_t svc_number;
/* /*