Differences between Debug and Release builds

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

Differences between Debug and Release builds

Jump to solution
496 Views
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 Kudos
1 Solution
486 Views
ErichStyger
Senior Contributor V

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

View solution in original post

0 Kudos
2 Replies
474 Views
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 Kudos
487 Views
ErichStyger
Senior Contributor V

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 Kudos