Skip to content

Commit 57ac6c8

Browse files
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.
1 parent e3b8514 commit 57ac6c8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/ipc/tfm_spm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "region_defs.h"
2828
#include "tfm_nspm.h"
2929
#include "tfm_memory_utils.h"
30+
#include "platform/mbed_toolchain.h"
3031

3132
/*
3233
* IPC partitions.
@@ -580,7 +581,7 @@ void tfm_spm_init(void)
580581
tfm_thrd_start_scheduler(&this_thrd);
581582
}
582583

583-
void tfm_pendsv_do_schedule(struct tfm_state_context_ext *ctxb)
584+
MBED_USED void tfm_pendsv_do_schedule(struct tfm_state_context_ext *ctxb)
584585
{
585586
#if TFM_LVL == 2
586587
struct spm_partition_desc_t *p_next_partition;

components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_handler.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <stdbool.h>
2020
#include "tfm_svcalls.h"
2121
#endif
22+
#include "platform/mbed_toolchain.h"
2223

2324
/* This SVC handler is called when a secure partition requests access to a
2425
* buffer area
@@ -135,7 +136,7 @@ __attribute__((naked)) void SVC_Handler(void)
135136
#error "Unsupported ARM Architecture."
136137
#endif
137138

138-
uint32_t SVCHandler_main(uint32_t *svc_args, uint32_t lr)
139+
MBED_USED uint32_t SVCHandler_main(uint32_t *svc_args, uint32_t lr)
139140
{
140141
uint8_t svc_number;
141142
/*

0 commit comments

Comments
 (0)