undefined reference to `__stack_chk_guard'

 

root@ubuntu:~/arm/armv8-bare-metal# make
aarch64-linux-gnu-ld -T linker.ld linker.ld boot.o vector.o exception.o kernel.o gic_v3.o uart.o psw.o aarch64.o timer.o -o kernel.elf
exception.o: In function `irq_handle':
/root/arm/armv8-bare-metal/exception.c:60: undefined reference to `__stack_chk_guard'
/root/arm/armv8-bare-metal/exception.c:60: undefined reference to `__stack_chk_guard'
/root/arm/armv8-bare-metal/exception.c:82: undefined reference to `__stack_chk_guard'
/root/arm/armv8-bare-metal/exception.c:82: undefined reference to `__stack_chk_guard'
/root/arm/armv8-bare-metal/exception.c:82: undefined reference to `__stack_chk_fail'
/root/arm/armv8-bare-metal/exception.c:82:(.text+0x444): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `__stack_chk_fail'
Makefile:32: recipe for target 'kernel.elf' failed
make: *** [kernel.elf] Error 1

 

CFLAGS 添加 -fno-stack-protector

posted on 2022-04-28 15:57  tycoon3  阅读(1127)  评论(0)    收藏  举报

导航