ARM64 Linux Kernel 5.7无法GDB调试问题

℡╲_俬逩灬. 提交于 2020-08-17 02:48:38

Linux主线Kernel刚发布了5.7,同步上去后,我的gdb调试功能异常了,加载内核一堆错误:

FD: warning: vmlinux: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
BFD: warning: vmlinux: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
BFD: warning: vmlinux: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
BFD: warning: vmlinux: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
BFD: warning: vmlinux: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
BFD: warning: vmlinux: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
BFD: warning: vmlinux: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
BFD: warning: vmlinux: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
BFD: warning: vmlinux: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
BFD: warning: vmlinux: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000
BFD: warning: vmlinux: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0000000

强行调试会出各种错误。

从这里(https://github.com/ClangBuiltLinux/linux/issues/844)可以知道,这是新的ARM8.3a+ PAC和BTI特性(指针和跳转健全)引起的,这两个特性需要binutils支持这种新的段类型,但gdb还没有支持。

查了一下内核的编译参数,在arch/arm64/Makefile中可以看到这个定义:

ifeq ($(CONFIG_ARM64_PTR_AUTH),y)
branch-prot-flags-$(CONFIG_CC_HAS_SIGN_RETURN_ADDRESS) := -msign-return-address=all
branch-prot-flags-$(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET) := -mbranch-protection=pac-ret+leaf
# -march=armv8.3-a enables the non-nops instructions for PAC, to avoid the
# compiler to generate them and consequently to break the single image contract
# we pass it only to the assembler. This option is utilized only in case of non
# integrated assemblers.
branch-prot-flags-$(CONFIG_AS_HAS_PAC) += -Wa,-march=armv8.3-a
endif

暂时不知道有稳定的支持的gdb可以使用,所以如果各位需要继续正常调试当前ARM的内核,请关掉这个配置项:CONFIG_ARM64_PTR_AUTH。

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!