// arch/arm64/kernel/head.S
#define __PHYS_OFFSET (KERNEL_START - TEXT_OFFSET)
// arch/arm64/include/asm/memory.h
#define KERNEL_START _text
// arch/arm64/kernel/vmlinux.lds.S
. = KIMAGE_VADDR + TEXT_OFFSET;
.head.text : {
_text = .;
HEAD_TEXT
}
因此:
__PHYS_OFFSET = (KERNEL_START - TEXT_OFFSET)
= (_text - TEXT_OFFSET)
= (KIMAGE_VADDR + TEXT_OFFSET - TEXT_OFFSET)
= KIMAGE_VADDR
这两个符号一个叫“物理偏移”,一个叫“虚拟地址”,,最终却是同一个取值??
离线