MCF5307- CW8.4 - Section does not appear in the memory map file

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

MCF5307- CW8.4 - Section does not appear in the memory map file

1,814 Views
Veter
Contributor I

I use CodeWarrior for ColdFire version 6.4.

My target is MCF5307.

I have following section declaration in the startup.s file:

.section .init
.global ___init
 ___init:   ; ___init_main called above.

 ; Linker supposed to place .init sections from other modules, containing
 ; calls to initialize global objects, here.

 rts   ; Return from ___init.
 

This section does not appear in the map file and other modules' init sections are not palced under it.

Any idea why it does not work or what I'm I missing?

Thank you!



Message Edited by Veter on 2007-06-11 09:51 PM
--
Alban Edit: please ALWAYS mention target and CW version in subject line.


Message Edited by Alban on 2007-06-11 09:53 PM
Labels (1)
0 Kudos
3 Replies

432 Views
CrasyCat
Specialist III
Hello
 
Is the function ___init used/ referenced somewhere in the application?
If the function is not used anywhere, it will not be linked to the application (dead stripping).
 
Then the linker will not add any code to the function __init. This is not a predefined function with a predefined behavior for the CodeWarrior linker.
 
I do not know what you are expecting here?
 
CrasyCat
0 Kudos

432 Views
Veter
Contributor I
It is declared in DIAB sysntax (WindRiver compiler). We migrated to the CW and so far it has been quite difficult to get any working suggestion. All this code does initializes global section that other modules used in the project can use to put their initializations under. Sample below shows source code and Output shows the expected result generated by linker. The question is how to do that with CW linker???
The same problem exists with startup of the project. Could you please give me a sample code that would show how it's done?
 
========== Sample 1============================
section .init$00,2,C
 XDEF ___init  ; Entry to ___init, called by
___init:   ; ___init_main called above.
 ; Linker places .init sections from other modules, containing
 ; calls to initialize global objects, here.
 section .init$99,2,C
 rts   ; Return from ___init.
 
========= Output 1 ============================
.init$00        fe0c40da 00000000 .\RTOS_Port\startup.o
   ___init fe0c40da 00000000
  .init$05        fe0c40da 00000006 C:\diab\4.4b\ACE0FS\libcfp.a[malloc.o]
  .init$15        fe0c40e0 00000006 C:\diab\4.4b\ACE0FS\libcfp.a[malloc.o]
  .init           fe0c40e6 00000006 .\source\CANController.o
  .init           fe0c40ec 00000006 .\source\CANPacketProcessor.o
0 Kudos

432 Views
CrasyCat
Specialist III
Hello
 
According to my understanding you are looking for a way to copy initialization values for global variables from ROM to RAM at startup.
This is done differently depending on the development tool chain you are using.
 
When you are developing with CodeWarrior if you have create your project from a MCF5307 stationery, the build target "CF M5307C3 4i ROM Release" is doing that.
The way this is done is explained in the following manual:
     {Install}\Help\PDF\ColdFire_Build_Tools_Reference.pdf
 
Look at chapter "Coldfire Linker" Section "LCF Syntax" -> "ROM-RAM Copying".
 
I hope this helps.
 
CrasyCat
0 Kudos