The variables are usually placed into an output region located in FLASH memory when linking, but the variables are not marked `const`, so the section ends up with `W` writeable section flag: ```bash ❯ arm-zephyr-eabi-readelf --section-headers build/zephyr/zephyr.elf | \ grep -E '(Section Headers:)|( \[Nr\])|(zephyr_dbg_info)' Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [10] zephyr_dbg_info PROGBITS 60012298 01238c 000040 00 WA 0 0 4 ``` Set them as const to set the output section to read-only: ```bash ❯ arm-zephyr-eabi-readelf --section-headers build/zephyr/zephyr.elf | \ grep -E '(Section Headers:)|( \[Nr\])|(zephyr_dbg_info)' Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [10] zephyr_dbg_info PROGBITS 60012298 01238c 000040 00 A 0 0 4 ``` Signed-off-by: Noah Pendleton <noah.pendleton@gmail.com> |
||
|---|---|---|
| .. | ||
| coredump | ||
| gdbstub | ||
| asan_hacks.c | ||
| CMakeLists.txt | ||
| gdbstub_backend.h | ||
| gdbstub.c | ||
| Kconfig | ||
| thread_analyzer.c | ||
| thread_info.c | ||