Differences between Debug and Release builds

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

Differences between Debug and Release builds

跳至解决方案
611 次查看
marc_v
Contributor I

Hello everyone.
In a project, 3 sectors of the KL27 are used to store particular information of the equipment that almost never changes.
Strings of characters are simply stored to be printed or displayed, either by referring to their name or through a vector of pointers where their addresses are stored.
The issue is that the Debug build sorts them in one order and the Release build sorts them in the reverse order.
I would like to know which compilation option I should modify to keep in both versions the order obtained in the Debug build. I attach an image where you can see details of the implementation, greetings!

Debug_vs_Release.png

0 项奖励
回复
1 解答
601 次查看
ErichStyger
Specialist I

First: I would check if they are listed differently in the linker file?

But: There is no guarantee of the order of the objects by any means, if you have them (as in this case) as single objects (and I assume the same for your linker file, or using wildcards).

If you want them in a defined order:

- have them in an array of things

- or: list them individually in the linker file

I hope this helps,

Erich

在原帖中查看解决方案

0 项奖励
回复
2 回复数
589 次查看
marc_v
Contributor I

Thank you very much Eric.
The 3 linker files generated for each build configuration (project_xx_memory.ld, project_xx_library.ld and project_xx.ld) are the same.
In this case it is not serious, since I access the different objects using their name and the compiler resolves the address to point to, I don't need to access them in an established order.
I've another problem and while reviewing I found this that caught my attention (and at first I thought it was the source of my problems, but no).
Your comments are welcome as always, I'll keep them in mind if I need to access each object using a harcoded address.

Greetings, Marcelo.

0 项奖励
回复
602 次查看
ErichStyger
Specialist I

First: I would check if they are listed differently in the linker file?

But: There is no guarantee of the order of the objects by any means, if you have them (as in this case) as single objects (and I assume the same for your linker file, or using wildcards).

If you want them in a defined order:

- have them in an array of things

- or: list them individually in the linker file

I hope this helps,

Erich

0 项奖励
回复