execute only region of v8m

Asked by chiche ma on 2017-04-19

Hi,

I want to compile code for execute only region of v8m and I notice there is a GCC option "-mpure-code".
But the gcc manual of "6.2 2016q4" said this option is only available when generating non-pic code for ARMv7-M targets,
that means I can't use this option for v8m? if so, do you have any plan to support that on v8m?

Sincerely,
Terry

Question information

Language:
English Edit question
Status:
Solved
For:
GNU ARM Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Prakhar Bahuguna
Solved:
2017-04-20
Last query:
2017-04-20
Last reply:
2017-04-20
Prakhar Bahuguna (prakhar) said : #1

Hi Terry,

-mpure-code is currently supported on ARMv7-M and ARMv8-M Mainline targets. It is not yet supported for ARMv8-M Baseline targets in the current release, though this may change in future.

Regards, Prakhar

chiche ma (ccma1120180) said : #2

Hi Parkhar,

Thanks for your reply,
I notice there is another -mslow-flash-data have the effect of using MOV/MOVT instead of literal pools.
Though the document said "it minimized literal load for slow flash performance", I wonder is it actually 0% literal load.
Thus I could use this option as an alternative for execute-only code of V8M baseline.

Sincerely,
Terry

Best Prakhar Bahuguna (prakhar) said : #3

Hi Terry,

The purpose of -mslow-flash-data is to minimize the occurrence of literals being loaded from a slow flash memory device, but unlike -mpure-code it does not guarantee that all literal loads from a text section will be completely eliminated, and thus you cannot necessarily rely on this if you wish to place your code in execute-only memory on your target. In any case, this will not work as an alternative as -mslow-flash-data is not yet supported on ARMv8-M Baseline targets either.

Hope this helps,

Prakhar

chiche ma (ccma1120180) said : #4

Thanks Prakhar Bahuguna, that solved my question.