This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

MRI compatible format,objcopy


Hi All
I m trying to port a code (M68k MOTOROLA) written for MRI  to GNU GCC. I
 m compiling few of the files with GNU GCC and remaining with MRI(microtec).
 Finally i m trying to link these files using MRI linker. And for 
intermediate format conversion (elf to ieee695 )i m using the GNU 
objcopy utility.

Doing this i m able to make the final executable but this executable 
dont run on the target board(motorola 68k). When i analised the map 
files generated i noted that only physically first function of GNU 
compiled file gets the proper section name and address, remaining 
functions are in a noname section.The part of the map file looks like:

Function Name       Section          Address    object module

_accept             .text            00000000   comm.o
_close                               00000102    $$
_get                                 0000064C    $$
_my_id                               0000087E    $$
_init                                00000158    $$
_mlbx                                00000432    $$
_open                                000003AE    $$
_pend                                000004BE    $$

Probably all the function have been assignd a common section,named ".text".

Now if i try to rename this section as "code" using objcopy utility the 
resulting map file will look like:

Function Name       Section          Address    object module

_accept             code             00007D7C   comm.o
_close                               00000102    $$
_get                                 0000064C    $$
_my_id                               0000087E    $$
_init                                00000158    $$
_mlbx                                00000432    $$
_open                                000003AE    $$
_pend                                000004BE    $$

Only first function is renamed as "code" with the proper address,remaining
 are having the same address as before.

Note that in MRI compiled files every function gets the section "code" 
with a proper addesss,but here in the case of GNU compiled file it is 
not happening.

further note that I dont get any error message from the compiler in the 
build process,but the code dont execute,giving error " Invalid 
Instruction ".

Now my questions:

1. Is the map file generated is correct (i really doubt) ?
2. Is the problem is because of format generated by objcopy.
3. How can i get a MRI compatible format( i have already tried -M option
 ) ? 
4. In most of the document it is written that object file format needs 
to be       enhanced to make it MRI compatible,but nobody talks how ?

If anyone has faced the same probem and can help me pls reply asap.

Thanks
Trilok Tak



_____________________________________________________________
Get email for your site ---> http://www.everyone.net

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]