This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
link 32bit .o with 64bit .o
- From: GuoMinskey <minskey_guo at hotmail dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Mon, 11 Apr 2011 02:54:28 +0000
- Subject: link 32bit .o with 64bit .o
On x86 platform, ?is there any means to link 32 bit ELF output into?64 bit ??
In Linux kernel, ?arch/x86/boot/compressed/head_64.S, ? starts from32-bit code?and enables CPU to jump into 64-bit. ?So, that file is?assembled?into 64 bit ELF?object with mixed 32/64 bit code.
Now, I want to call a routine from somewhere in the 32bit code part?of head_64.S. ? ?And I write the routine by C language, ?say test.c?and compile ?it with "gcc -m32 -c -o test.o". ? ?How can I link mytest.o to head_64.o ? ?Or I have to use assembly language to rewritemy routine and embed it directly into head_64.S source code ?
please reply me directly
thanks,-minskey