Closed Hadatko closed 1 year ago
Here is picture from compiling code with assert:
For example assert for heap and stack make sense to keep as they are located in same memory space (m_data)
Matchies:
Thank you for the notification and appreciate for your patience, already forwarded the issue to internal team for check.
Hi Hadatko, The assert here is to ensure the built binary can be accommodated into the flash. Otherwise the application cannot boot from flash. Rationale: Both code and data need to be put into flash (region defined by m_text). If the code + data size exceeds the flash size, the assertion will be triggered and it's an expected behavior.
Hi @nxp-wayne, i understand your point. But shouldn't linker itself throw error if m_text would overflow?
Hi @nxp-wayne just thinking: If we will do bellow change, we will get linker error. So the result is same without assert. Am i right?
I will close this PR as it showed up ASSERT is really needed. Thank you.
Signed-off-by: Cervenka Dusan cervenka@acrios.com
Prerequisites
Describe the pull request
It looks like linker files (maybe also for different targets) contains ASSERT which was copied and paste without checking and evaluating its reason. As data section compared with assert are from different memory sections and between them exists another sections which are not checked and it is throwing error even memory sections are not completely used i think this assert should be removed.
Please check also other linker files if you agree with me
Type of change
Tests