Differences between Debug and Release builds

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Differences between Debug and Release builds

ソリューションへジャンプ
1,281件の閲覧回数
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 解決策
1,271件の閲覧回数
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 返答(返信)
1,259件の閲覧回数
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 件の賞賛
返信
1,272件の閲覧回数
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 件の賞賛
返信