zephyriot / zep-jira14

0 stars 0 forks source link

program text should be in its own memory region #2031

Open nashif opened 7 years ago

nashif commented 7 years ago

Reported by Andrew Boie:

We need to make sure that there is a split between rodata and program text, program text should be executable (and probably not readable), rodata should be read-only and not executable. We should be able to accomplish this in the linker scripts.

(Imported from Jira ZEP-2193)

nashif commented 7 years ago

by Andrew Boie:

I think this mostly already exists. text and rodata alredy in different binary sections. We have _image_text_start / _image_text_end linker variables already defined. We do not yet have linker variables for RODATA but can easily add them. Think the only work here is to ensure that both the text and rodata sections are aligned properly so that can either can be in different MPU regions, or that each starts at a page boundary for setting MMU permissions.

nashif commented 7 years ago

by Andrew Boie:

Do we actually need this? I think it may be sufficient to just mark all of ROM read-only, execute. Setting this aside until further discussion.