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。
来源:oschina
链接:https://my.oschina.net/u/4258525/blog/4299713