Linking error when building release version

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Linking error when building release version

跳至解决方案
1,422 次查看
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 项奖励
回复
1 解答
1,415 次查看
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 项奖励
回复
2 回复数
1,416 次查看
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 项奖励
回复
1,412 次查看
JBM
Contributor V

Thanks Erich.  That worked.

0 项奖励
回复