AnsweredAssumed Answered

No linker error when exceeding m_text because of __DATA_ROM

Question asked by Tom Christiansen on Dec 10, 2019
Latest reply on Feb 6, 2020 by Tom Christiansen

Using the default linker file for the S32k144 that the S32DS comes with, the linker fails to generate an error when the allowed size for the m_text is exceeded.  Looking at the linker file it doesn't directly put the data ROM into m_text but rather creates some variables and uses those.  This prevents the linker from generating an error when the assigned sized of m_text is exceeded.


In my case my linker for the m_text looks like this

m_text (RX) : ORIGIN = 0x00002404, LENGTH = 0x0000FBFC


I would expect that if anything stored in this section goes beyond 0x12000 the linker would generate an error.


If the .text section exceeds the size it triggers and error.


However these two sections also go into flash but do not trigger an error because they are not directly placed into m_text but rather use variables defined in the linker file (__DATA_ROM & __CODE_ROM)

.data : AT(__DATA_ROM)
.code : AT(__CODE_ROM)


How can I get the linker to properly trigger an error?