How to compile and link 32 bit c code with 64 bit c code‏

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, 
 
I am making a 32 bit project to call some 64 bit functions.
So, I have most of c files which will be compiled and linked into 32 bit binary.And I have some c files including those functions which will be compiled into 64 bit binary.
Of course, I will call into assembly first to set up 64 bit mode, and then call those 64 bit functions, finally I will return to assembly to get back to 32 bit mode. 
 
Now I have a problem how to compile and link those 32 bit code with those 64 bit code together into one object file (like xxx.gz) 
Unlike assembly, which is easy to embed ".code32" or ".code64" in assembly to distinguish 32 bit code and 64 bit code, (see the document "Using as The GNU Assembler"), how can I achieve this for c files? Or are there any examples to tell me to achieve this? 
 
Thanks.
Qing  		 	   		  
_________________________________________________________________
Windows Live Hotmail: Your friends can get your Facebook updates, right from Hotmail®.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_4:092009

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux