摘要:
将多个.o文件链接成可执行文件的时候。如果链接的顺序不对,会产生错误。《An introduction of gcc》里面有下面一段话:On Unix-like systems, the traditional behavior of compilers and linkersis to search for external functions from left to right in the object filesspecified on the command line. This means that the object file whichcontains the defini 阅读全文
摘要:
今天在写kernel的时候碰见这么一个错误,undefined reference to `__stack_chk_fail'出现错误的地方是在 void disp_Int(int num)调用了,void itoa(char* str, int num).如果不想使用gcc的堆栈溢出保护可以使用:CFLAGS add -fno-stack-protector when compile下面是添加保护的代码: What is it? The GCC SSP protects the stack from buffer overflows. If a buffer overflow occ 阅读全文