This patch load PT_NOTE section in to memory so the debugger can compare the kernel with corresponding coredump. WIth this patch, debugger can prevent developer falsely load the kernel with unmatched coredump. As the note section is as small as 448 bytes in my build. I think it is a reasonable tradeoff.
I have send a corresponding PR in LLDB.
There is an example about this patch:
sudo lldb -O "log enable lldb dyld" /boot/kernel.old/kernel --core /dev/mem
Result:
(lldb) target create "/boot/kernel.old/kernel" --core "/dev/mem" lldb DynamicLoaderFreeBSDKernel::CheckForKernelImageAtAddress: looking for kernel binary at 0xffffffff80200000 lldb DynamicLoaderFreeBSDKernel::CheckForKernelImageAtAddress Cannot match coredump with binary by build-id Core file '/dev/mem' (x86_64) was loaded.