I need to generate a machine code of different C codes. I compiled C codes by using soucery code bench I can compile it successfully and get the assembly code and executable file what I have a problem I need a machine code only than I can put that machine code on FPGA . I have one way to get to get is use -objdump command means decompile the executable but this decompile file is in the elf format add a lot of this so if any one knows how to get only machine code. It would be very helpful for me.
2 Answers
0
votes
0
votes
thanks for the reply
this command work but give me an empty text file, what I do.
~/Mentor_sourcery/bin/mips-linux-gnu-gcc -x C_code.c it gives me an executable a.out.
then i run ~/Mentor_sourcery/bin/mips-linux-gnu-objdump -x a.out >foo1.txt
it gives me elf formatted file.
3.then ~/Mentor_sourcery/bin/mips-linux-gnu-readelf -x foo1.txt >final.txt
this command run without any error but gives me an empty .txt file