Help Needed regarding MTCgnu
Mon Dec 16 07:30:00 GMT 2002
> I took a simple program of hello world and got the assembly code
> by using -S option with gcc. Next I compiled it to an executable
> file by using the assembler as-mcore.
Please could you reproduce the exact compiler, assembler and linker
command lines that you used.
Are you aware that the assembler only creates an object file, it does
not create an executable ? Strangely enough however, if you do not
give the assembler a command line option to name the output file (eg
"-o hello.o") then it will default to calling the object file "a.out"
even though it is *not* an executable file.
> On executing it using run-mcore it exits giving message:
> "program stopped with signal 4"
How did you try to execute the program ? ie were you running it on a
simulator or an MCore board ? What command line did you use to
execute the program ?
> On debugging it , it fails with message
> "Program received signal SIGILL, Illegal Instruction
> 0x2 in main()"
How were you attempting to debug it ? What gdb commands did you use ?
> the assembly code is :
After making one change to the assembly file that you included I was
able to assemble, link and run it against a simulator. The output
this is a test.
The change was to delete this instruction:
This is because the current version of gcc for the MCore no longer
uses the __main function to perform static initialisation.
More information about the Gcc-help