including c headers in assembly
including c headers in assembly
How do you include a c header file in an assembly file under binutils? Lets say I define a function in func.c, declare it in func.h, and want to call it from func.s by including func.h. Does it matter or do you just declare the function external within func.s and let the linker patch it up?
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
Re: including c headers in assembly
use extern directive provided by the assembler instead . you can offcourse use the same #include and use the c preprocessor (macro processor) , if all you want to do is include the file.
Regards
Shrek
Regards
Shrek
Re: including c headers in assembly
There is a tool called h2inc or something, that converts C header files into assembler-processable include files. Haven't tried it though.