Linking error when building release version

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linking error when building release version

Jump to solution
831 Views
JBM
Contributor V

I am developing an application for the LPC844M201JHI33Y (no hardware yet - did most of it with the LPC845 development kit and then created a new project for the LPC844 and copied the code over).  

I'm using MCUXpresso version 11.6.1.  SDK was built and downloaded in January.

I have a debug version of the code that compiles and links with no errors.  I created a release configuration from the debug configuration and changed debugging information to minimal and SDK_DEBUGCONSOLE=2 (no debug console).  This release version compiled and linked with no errors.

I then changed the preprocessor defined symbol "DEBUG" to "NDEBUG" and I get an error in linking:

"cannot move location counter backwards (from 000003ac to 000002fc)"

I know 0x2FC is the address of the code read protection word which I haven't changed.  

I compared all the linker files (*.ld) between the DEBUG and RELEASE versions and they are the same except for the creation times in the comments.

I tried different library versions (NewLib, NewLibNano, RedLib) and it does the same thing with all.

Any idea what is going on?

 

0 Kudos
Reply
1 Solution
824 Views
ErichStyger
Specialist I

It is because the linker tries to fit in a block into that space, and fails because of memory 'segement' size.

Try changing that option in the project settings for the linker:

ErichStyger_0-1678988570642.png

I hope this helps,

Erich

 

View solution in original post

0 Kudos
Reply
2 Replies
825 Views
ErichStyger
Specialist I

It is because the linker tries to fit in a block into that space, and fails because of memory 'segement' size.

Try changing that option in the project settings for the linker:

ErichStyger_0-1678988570642.png

I hope this helps,

Erich

 

0 Kudos
Reply
821 Views
JBM
Contributor V

Thanks Erich.  That worked.

0 Kudos
Reply