Command line linker problem with referrenced file in LCF

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

Command line linker problem with referrenced file in LCF

8,434 Views
jballes
Contributor II
Hello,
 
I am having the problems in command line of CodeWarrior (with the MMI it works fine).
We have a LCF file containing a reference to an external file as follows:
 
    .
    .
    .
.code :
   {
      ALIGNALL( 32 );
      ___VECTOR_START = .;  
     vectors.s (.text)
      ___VECTOR_END = .;      
      *(.text)
      *(.rodata)
      ___DATA_ROM = .;
   } > code
    .
    .
    .


For information, the referenced file “vectors.s” contains the definition of the vector table. I can send you a copy of this file if you need, but I think that you won’t need it.
Whenever we launch the linker (we are using CodeWarrior 6.3 for Coldfire), the linker says that it cannot find the file “vectors.s”:
 
mwldmcf -nodefaults -msgstyle gcc -g -proc MCF5282 –map “C:\PROGRA~1\Rational\TESTRE~1\targets\CWARRI~2\CW\PF08476.lcf"  "C:\integral\CFBOOTLOADER\TU\CF Bootloader\cwarrior_coldfire_t32_common_bootloader\vectors.o" <other .o files> -o ".\cwarrior_coldfire_t32_common_bootloader\Test_CRC.elf"  -L"C:\integral\CFBOOTLOADER\SOURCES\SERVICE\Metrowerks\E68K_SUPPORT\Libraries" -L"C:\integral\CFBOOTLOADER\SOURCES\SERVICE\Metrowerks\E68K_SUPPORT\Runtime" -L"C:\integral\CFBOOTLOADER\SOURCES\SERVICE\Metrowerks\E68K_SUPPORT\msl\MSL_C\MSL_E68k\Lib" -lfp_coldfire.o -lC_4i_CF_Runtime.a -lC_4i_CF_MSL.a
mwldmcf: Linker command file error at line 58
mwldmcf: File not found: vectors.s

I have tried the following workarounds without success:
-           Placing the full path within the LCF
-           Placing “vectors.s” at the same place as the LCF and within the current path.
-           Including the “vectors.s” file to the linker command line as if it were an output file.
 
Do you know how to solve this problem?

Thanks in advance,

Javier
Labels (1)
13 Replies

2,279 Views
ajays
Contributor I
hello crassycat,
 
thanks for the reply.
i am trying to automate the process by using an infinite while loop and it is working. But now i want to quit the IDE automatically. How can this be done?
 
I tried using quitIDE in the script. But it is not doing the job.
I also tried
 cmdIDE /d scriptfile /q  from command line, but it is quitting without debugging.
 
Any way out?..
 
 
 
 
0 Kudos

2,279 Views
CrasyCat
Specialist III
Hello
 
quitIDE is the appropriate command to close the IDE.
If you have a running debug session, I would recommend to first kill the debug session (command kill)
and then use quitIDE.
 
I can close the IDE is I enter command quitIDE in the command window or in a tcl script and it did in fact close the IDE.
 
Be careful the command window is case sensitive so you need to watch for upper and lower cases 
 
CrasyCat
0 Kudos

2,279 Views
CrasyCat
Specialist III
Hello
 
Are you building from the command line or from the IDE?
 
If you are building from the command line you need to specify the name of the object file
generated by the macro-assembler in the lcf file.
 
If you are building from the IDE, you have to specify the source file name in the lcf file.
 
CrasyCat

2,279 Views
jballes
Contributor II
Hi CrasyCat,

Thanks for your quick answer, it works!

I am using the command line, so as you explained to me, I changed from "vectors.s" to "vectors.o" within the LCF and the linker accepts it with charm.

Thanks again,

Javier
0 Kudos

2,279 Views
ajays
Contributor I
Hello,
 
I am very new to Codewarrior IDE. We are also trying to use it with RTRT. I am facing problems while linking in command line. It is showing errors like:
 
mwldmcf.exe: between 0x00000000-0x00007FFF or 0xFFFF8000-0xFFFFFFFF in memory.
mwldmcf.exe: Illegal 16-bit absolute address reference to symbol '__atc_data1'                                         
mwldmcf.exe: from address 0x0000000A in section '.text' of file
mwldmcf.exe: 'main_cdwarior.o '.                                                                       
mwldmcf.exe: Check linker command file to make sure symbol is located                                                          
mwldmcf.exe: between 0x00000000-0x00007FFF or 0xFFFF8000-0xFFFFFFFF in memory.
mwldmcf.exe: Illegal 16-bit absolute address reference to symbol '_atl_out'                                            
mwldmcf.exe: from address 0x0000002E in section '.text' of file 'TP.o'.                                                    
mwldmcf.exe: Check linker command file to make sure symbol is located.
 
This is what i have done:   
 
1) I have opened a sample project for MCF5282. Built it and executed succesfully on IDE.
2) I have compiled the sample main.c from command line to generate main.o with options:
    mwccmcf -c -v main.c    (is this enough?)
3)  I am using only the default ".LCF" file given in project directory: M5282EVB_INT_ROM.lcf without any modifications.
 
I have used the following in command line:
 
mwldmcf -nodefaults  -g -proc MCF5282 –map “C:\Program Files\Freescale\CodeWarriorV6.4\(CodeWarrior_Examples)\new\sources\M5282EVB_INT_ROM.lcf" main.o  -L"C:\Program Files\Freescale\CodeWarriorV6.4\E68K_SUPPORT\Libraries"
-L"C:\Program Files\Freescale\CodeWarriorV6.4\E68K_SUPPORT\Runtime"
-L"C:\Program Files\Freescale\CodeWarriorV6.4\E68K_SUPPORT\msl\MSL_C\MSL_E68k\Lib"              -lfp_coldfire.o -lC_4i_CF_Runtime.a
 
Can you help please...
0 Kudos

2,279 Views
jballes
Contributor II

Hi Ajays,


I will explain to you what I have done to make CodeWarrior work with RTRT. I’m not very experienced with CodeWarrior neither, so you may need to look further. I would say, however, that your problem comes from the vector table defined in your LCF file.


But before starting, the first question is if you have a working project with the IDE. If the answer is no, you will need to make things work.


Once you have a project working with the IDE, you have all the elements. For the compilation, what I do is:

mwccmcf -c -pragma "mpwc_relax on" -gccext on -nodefaults -msgstyle gcc -gccinc -ppopt line,full,space -g -model far -abi compact -proc MCF5282 -inline off   -I"<include_paths>" "C:\main.c" -o "main.o"


Like this for all your C files (you may also need to use the assembler if you have some files also). For the linking, you need to use the following command:
 

mwldmcf -nodefaults -msgstyle gcc -g -proc MCF5282 -map "C:\PROGRA~1\Rational\TESTRE~1\targets\CWARRI~2\CW\PF08476.lcf"  "<O files>" -o ".\cwarrior_coldfire_t32_common_bootloader\bootloader.elf"  -L"C:\Program Files\Freescale\CodeWarrior for ColdFire V6.3\E68K_Support\Runtime" -L"C:\Program Files\Freescale\CodeWarrior for ColdFire V6.3\E68K_Support\Libraries" -L" C:\Program Files\Freescale\CodeWarrior for ColdFire V6.3\E68K_Support\Runtime" -L"C:\Program Files\Freescale\CodeWarrior for ColdFire V6.3\E68K_Support\msl\MSL_C\MSL_E68k\Lib" -lfp_coldfire.a -lC_4i_CF_Runtime.a -lC_4i_CF_MSL.a


You need to be sure that you will pass to the linker as many files as you have in the “Link Order” tab of your IDE for your working project.


It’s not an easy task to make RTRT work with CodeWarrior, but it’s not impossible.


Good luck,


Javier

0 Kudos

2,279 Views
CrasyCat
Specialist III
This is a different question, so I opened a new Thread for it.
0 Kudos

2,279 Views
ajays
Contributor I
hello,  
 i am facing problem to get back the results. I am doing it on host (CC-SIM). I have followed the steps given in
help-> Targetting Coldfire,  to run my .elf file. I then run the debugger script. But there are no
conditional breakpoints in help except for bp. That does not help to dump the buffer each time write
function is hit.
I also tried to use fopen,fwrite. But they are giving undefined even in codewarrior IDE.
How to go about?
Please guide..
Thanks & Regards,
Ajays
0 Kudos

2,279 Views
CrasyCat
Specialist III
Hello
 
Can you please be a little bit more specific?
What are you trying to do exactly?
 
CrasyCat
0 Kudos

2,279 Views
jballes
Contributor II
Hi again,

Well, I don't use the same debugging environment as you, so I cannot provide much help (I use Trace32).

However, to trace the RTRT results, you need to set breakpoints to the funtion _priv_writeln. You don't need conditional breakpoints there.

You will have then to dump the contents of _atl_buffer, then... At least, this is what we do and it works, even with big test results (with coverage and runtime tracing enabled) and from the real target. I don't understand why you say that it does not help to dump the buffer at each write hit.

Hope this help,

Javier
0 Kudos

2,279 Views
ajays
Contributor I
Hello Javier/CrassyCat,
 
 I am able to put break points at priv_writeln using keyword 'bp' and dumping atl_buffer using keyword 'evaluate'. But when i give command 'go', the execution stops. I cannot move further. ie i need to dump the atl_buffer value until i reach the function priv_close.
 
I want to automate the process ie using a debugger script. At present i am using like this:
 
bp priv_writeln
bp priv_close
go
evaluate atl_buffer
 
But it stops after dumping the result once. How can i automate this process so that i can keep on dumping the results each time i hit the breakpoint for priv_writeln and exit when i reach priv_close.
 
Hope you can guide me in this,
 
Thanks in advance,
 
ajays
 
 


Message Edited by ajays on 2007-07-31 12:09 PM
0 Kudos

2,279 Views
CrasyCat
Specialist III
Hello
 
Debugging in the IDE you can achieve that using eventpoints.
 
Just set a scriptpoint on function priv_writeln and associate it with the "evaluate atl_buffer" command,.
Set another scriptpoint on function priv_closeand associate it with the "kill" command.
You can also specify whether you want to stop execution of the debugger when the script point is reached.
 
Running application should print value of atl_buffer each time priv_writeln is invoked and should kill the debug session when priv_close is invoked.
 
Unfortunately there are no command available to define an eventpoint (or script point) in a tcl script
 
Only way I can think about to get that working is the following:
  - Open your project in the IDE
  - Set your event points as described above
  - Open the command window
  - Run the application.
 
I did not try it myself, but this should be working.I hope this helps.
 
CrasyCat
0 Kudos

2,279 Views
ajays
Contributor I
hello jablles,
 
 Thank you so much for the qiuck reply. Well in fact now the linking part is working fine.I am at present working with a sample project. I'll get back to you if i face further problems.
 
Thanks again,
 
Ajays
0 Kudos