Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch: arc: fix size of sections #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

xxkent
Copy link

@xxkent xxkent commented Sep 27, 2023

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants