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

alignment of __bss_end__ #3

Open
prof7bit opened this issue Nov 3, 2016 · 1 comment
Open

alignment of __bss_end__ #3

prof7bit opened this issue Nov 3, 2016 · 1 comment

Comments

@prof7bit
Copy link

prof7bit commented Nov 3, 2016

I found another alignment problem, this time i was experimenting with the FRDM-KL25z board, I experienced a hardfault whithin the bss zero loop (using a modified startup assembly from freescale with loop to zero the bss) and it was due to a misaligned bss_end symbol.

I have not looked into the other examples, I noticed the MKL26 example does not even use bss_end in the startup but I seem to recall that some others do.

the following patch will fix it:

$ git diff MKL25Z32xxx4.ld
diff --git a/empty_project_frdm_kl25z/kl25_src/MKL25Z32xxx4.ld b/empty_project_frdm_kl25z/kl25_src/MKL25Z32xxx4.ld
index 4beb27f..b3c99a4 100644
--- a/empty_project_frdm_kl25z/kl25_src/MKL25Z32xxx4.ld
+++ b/empty_project_frdm_kl25z/kl25_src/MKL25Z32xxx4.ld
@@ -135,6 +135,7 @@ SECTIONS
         __bss_start__ = .;
         *(.bss*)
         *(COMMON)
+        . = ALIGN(4);
         __bss_end__ = .;
     } > RAM
@0xc0170
Copy link
Owner

0xc0170 commented Nov 6, 2018

Hi, I've missed this bug report, sorry about that. I'll check and fix this alignment (feel free to send PR anytime)

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

No branches or pull requests

2 participants