I'm trying to compile assembly and C code together (not C to assembly), but can't get it done.
For example:
file common.h
#ifndef __COMMON_H__
#define __COMMON_H__
struct tree{
tree* left;
tree* right;
void* elem;
};
void foo(int c);
#endif
file common.S
#include "common.h"
.text
.globl foo
.ent foo
foo:
//foo implementation
.end foo
When I try to compile this:
# gcc -c common.S
common.h: Assembler messages:
common.h:5: Error: unrecognized opcode `struct tree{'
common.h:7: Error: unrecognized opcode `tree* left'
common.h:8: Error: unrecognized opcode `tree* right'
common.h:10: Error: unrecognized opcode `void* elem'
common.h:12: Error: junk at end of line, first unrecognized character is `}'
common.h:14: Error: unrecognized opcode `void foo(int c)'
Is there any way to take C-definitions into assembly using gcc?