foss-for-synopsys-dwc-arc-processors / embarc_osp

embARC Open Software Platform (OSP) - An embedded software distribution for IoT and other embedded applications for ARC
https://www.embarc.org/
BSD 3-Clause "New" or "Revised" License
70 stars 62 forks source link

arch: arc: fix size of sections #178

Open xxkent opened 10 months ago

xxkent commented 10 months ago

Startup code may have exceeded the sections sizes while clear/copy them and erase data beyond its boundaries. -------------------------8-------------------------- _s3_clear_bss: mov r0, _f_bss mov r1, _e_bss cmp r0, r1 jge _arc_reset_call_main mov r2, 0 _s3_clear_bss_loop: st.ab r2, [r0, 4] cmp r0, r1 jlt _s3_clear_bss_loop -------------------------8------------------------- Since we use 4 byte load/store instructions while working with sections let's align section boundaries to the same 4 bytes.