[PATCH 09/10] libdl/rtl-obj.c: ensure that loaded code is synchronized through caches.

pisa at cmp.felk.cvut.cz pisa at cmp.felk.cvut.cz
Mon Jul 4 00:07:13 UTC 2016


From: Pavel Pisa <pisa at cmp.felk.cvut.cz>

Synchronize each cluster of sections of the same type separately
to support even cases where text and data are allocated from different
areas (for example due allocation from different MPU protection regions).

rtems_cache_instruction_sync_after_code_change is called even to data
sections. Propagation of data only changes should not require cache
maintenance operation on sane SMP mutithread capable systems if barrier
instruction is added but be on safe side even for case where self
modifying code uses data sections initial values etc.
---
 cpukit/libdl/rtl-obj.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cpukit/libdl/rtl-obj.c b/cpukit/libdl/rtl-obj.c
index 5c89990..00a1c6e 100644
--- a/cpukit/libdl/rtl-obj.c
+++ b/cpukit/libdl/rtl-obj.c
@@ -618,6 +618,8 @@ rtems_rtl_obj_sections_loader (uint32_t                     mask,
       first = false;
     }
 
+    rtems_cache_instruction_sync_after_code_change(base, base_offset);
+
     node = rtems_chain_next (node);
   }
 
-- 
1.9.1




More information about the devel mailing list