Open chrisc11 opened 5 years ago
CC @andrewboie @ioannisg
Hi @nashif,
This issue, marked as an Enhancement, was opened a while ago and did not get any traction. It was just assigned to you based on the labels. If you don't consider yourself the right person to address this issue, please re-assing it to the right person.
Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.
@chrisc11 you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.
Thanks!
Is your enhancement proposal related to a problem? Please describe.
The elf section with the vector table gets marked as (
W
)ritable even if it's placed inFLASH
, i.eThis happens because the vector tables created in
gen_isr_tables.py
are not defined with aconst
qualifier. If non-const data is placed in a read-onlyMEMORY
section, the gnu linker will auto-promote the section to have theSHF_WRITE
bit set.While this does not cause any runtime issues, it does:
arm-none-eabi-size
to classify the region as data rather than textDescribe the solution you'd like
I think
sw_isr_table.h
,isr_tables.c
, &gen_isr_tables.py
could simply be patched to add aconst
qualifier to_irq_vector_table
&_sw_isr_table
when the vector table is not dynamicAdditional context
Here's an example output of the
west -v build -b nrf52840_pca10056 samples/basic/threads/
before/after a patch marking the sections as const was made:Before:
After:
(NB: It also looks like the structs placed in
.devconfig.init
are also not marked asconst
but are placed inROM
. For similar reasons might be nice to mark those structures asconst
but that's probably outside the scope of this issue)