Moving from Codewarrior to KDS

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

Moving from Codewarrior to KDS

435 Views
maiden
Contributor I

We are currently trying to move a project from Codewarrior to KDS we get it to compile but the size have become too big to fit on the device, we have checked the flags and options in the settings menu several times.

any ideas what can cause this?

 

we are using the same ld script to map the memory but it still differs slightly, here is a comparison between CW and KDS from size:

CW.elf  :

section                size        addr

.interrupts             248           0

.text                 61256        2048

.data                   704   536862720

.user_data2            8128   536870912

.bss                   3764   536863424

._user_heap_stack      2048   536867188

.romp                    36   536879040

.ARM.attributes          51           0

.debug_info          129740           0

.debug_abbrev         30041           0

.debug_loc            52002           0

.debug_aranges         7296           0

.debug_macinfo      9318816           0

.debug_line           89064           0

.debug_str            34856           0

.comment                121           0

.debug_frame          16712           0

Total               9754883

 

vs

 

 

KDS.elf  : (had to disable some features to get it to compile, thats why its smaller here)

section                size        addr

.interrupts             248           0

.text                 83880        2048

.init_array               4       85928

.fini_array               4       85932

.data                  1780   536862720

.user_data2            8128   536870912

.bss                   3504   536864504

._user_heap_stack      2048   536868008

.romp                    36   536879040

.ARM.attributes          49           0

.comment                 59           0

.debug_info           98499           0

.debug_abbrev         17554           0

.debug_loc            32993           0

.debug_aranges         6232           0

.debug_macinfo      9351000           0

.debug_line           81953           0

.debug_str            31048           0

.debug_frame          19452           0

Total               9738471

 

And why do i get .init/finit_array now and not before? is there a flag i can set to remove it?

Labels (1)
0 Kudos
1 Reply

284 Views
BlackNight
NXP Employee
NXP Employee

Have you turned on compiler optimizations? The default in KDS is -O0 which means no optimization. Use at least -O1 or even -O3.

The additional section names come because KDS is using the standard GNU libray, while CW has its own implementation of the library.

Another difference would be what kind of functionality your application is using: is it using printf() and the like?

And are you already using the newlib-nano?

Erich

0 Kudos