アセンブリと C コードを一緒にコンパイルしようとしていますが (C からアセンブリへではなく)、それを実行できません。
例えば
ファイル common.h
#ifndef __COMMON_H__
#define __COMMON_H__
struct tree{
tree* left;
tree* right;
void* elem;
};
void foo(int c);
#endif
ファイル common.S
#include "common.h"
.text
.globl foo
.ent foo
foo:
//foo implementation
.end foo
これをコンパイルしようとすると:
# 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)'
gcc を使用して C 定義をアセンブリに取り込む方法はありますか?
前もって感謝します。