This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Create binary from GCJ generated assembly
- From: isuru herath <isuru81 at yahoo dot com>
- To: java at gcc dot gnu dot org
- Date: Tue, 27 Oct 2009 01:22:38 -0700 (PDT)
- Subject: Create binary from GCJ generated assembly
Dear All,
I want to add two assembly instructions to my Java program. Earlier I was doing it in C with "asm volatile". To get the same behavior in Java I used JNI. I used GCJ with -fjni flat to crate the binary. It executed and gave the correct output. But when I checked the memory references between two assembly instructions it is very high compared to the C program. Thereafter I got the assembly version of both C and Java codes with -S option. In C version, assembly instructions are directly inserted in the proper places. But in Java version library calls are placed in the places where assembly should be inserted. I doubt this may be the case for larger memory references. So my question is is there a way to edit the gcj generated assembly and insert assembly instructions and compile it to a binary. I tried two different ways(trial and error). Nothing worked.
[1]
gcj --main=new_shared_counter -o new_shared_counter new_shared_counter.s
[2]
gcc shared_counter.s
Any help on how to compile a gcj generated assembly to binary would be greatly appreciated.
regards,
Isuru