gcc编译时出现In function ‘_start‘: (.text+0x**) undefined reference to `main’…
因为是汇编文件 爆出这条错误,所以对 $(CC) $(AFLAGS) -c $< -o $@中的 AFLAGS加上 -share选项
加入之后报了更奇怪的错误
relocation R_MIPS_HI16 against `g_losTask' can not be used when making a shared object; recompile with -fPIC
因为我们的命令行使用 了 -fno-pic选项,这个选项是是告诉编译器不要生成 PIC 的代码。
接下来取消掉-share选项
在los_dispatch.S和start.s中加入import和export来添加缺失的符号文件
import:翻译为进口或引入,表明要调用的函数为外部文件定义
export:翻译为出口或输出,表明该符号可以被外部模块使用,类似于C中的extern功能。
编译器貌似不支持import和export 出现报错
: Error: unknown pseudo-op: `.export'
尝试去掉AFLAGS CFLAGS中的 -fno-pic