mbox series

[0/2,ipa,Arm] Fix cloning of 'cmse_nonsecure_entry' functions

Message ID 712b0e9d-0d6a-c6de-07bf-f70799d0417a@arm.com
Headers show
Series Fix cloning of 'cmse_nonsecure_entry' functions | expand

Message

Andre Vieira (lists) Oct. 8, 2019, 3:20 p.m. UTC
Hi,

This patch series is aimed at fixing an issue when cloning a function 
with 'cmse_nonsecure_entry' attribute.
Currently if gcc determines to clone a function with this attribute, 
both the cloned and original declarations will be compiled as nonsecure 
entry functions.  The linker eventually complains about a non-global 
cmse entry function and errors out.

It is legal to clone these functions, since the clone will only be used 
directly by the same translation unit as the original cmse entry 
function.  However, the clones should not be marked as entry functions. 
So in patch 1 I'll add a target hook that allows each target to sanitize 
the cloned declaration's attributes and in patch 2 I'll make the arm's 
implementation of it remove 'cmse_nonsecure_entry' from the cloned 
declaration's attribute list.

Andre Vieira (2)
[Patch 1/2][ipa] Add target hook to sanitize cloned declaration's attributes
[Patch 2/2][Arm] Implement TARGET_HOOK_SANITIZE_CLONE_ATTRIBUTES to 
remove cmse_nonsecure_entry

Bootstrapped the series on x86_64 and built arm-none-eabi, running the 
cmse testsuite for armv8-m.main and armv8-m.base.

Cheers,
Andre