arm64 entry point
Hi,
There is some discrepancy between what booting.txt says and what our linker script defines as the kernel entry point.
Here is booting.txt:
The primary CPU must jump directly to the first instruction of the kernel image.
And the linker script:
ENTRY(stext)
Should we change booting.txt, or the linker script?
-Geoff
Quoted 1 line · Geoff Levand
Hi,
Hi Geoff,
Quoted 5 lines
There is some discrepancy between what booting.txt says and what our linker script defines as the kernel entry point.
Here is booting.txt:
Quoted 8 lines
The primary CPU must jump directly to the first instruction of the kernel image.
And the linker script:
ENTRY(stext)
Should we change booting.txt, or the linker script?
We should fix the linker script to have the correct entry address.
Care to send a patch?
Will
PATCH 1/1 arm64: Fix linker script entry point
Change the arm64 linker script ENTRY() command to define _text as the kernel entry point.
The arm64 boot protocol specifies that the kernel must be entered at the beginning of the kernel image. The existing ENTRY() command defined the symbol stext as the entry point, which emitted an incorrect entry point, but would not cause a runtime error because the existing entry code immediately jumps to stext.
---
Hi Will,
As requested, here is a fix for the linker script. There are a lot of ways we can define the entry point. Let me know if you want to do it differently.
-Geoff
arch/arm64/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/vmlinux.lds.S +1 -1
@@ -13,7 +13,7 @@ #define ARM_EXIT_DISCARD(x) x OUTPUT_ARCH(aarch64) -ENTRY(stext) +ENTRY(_text) jiffies = jiffies_64;
Signature · 1 line
1.9.1
PATCH 1/1 arm64: Fix linker script entry point
Quoted 9 lines · Geoff Levand
Change the arm64 linker script
ENTRY()command to define_textas the kernel entry point.The arm64 boot protocol specifies that the kernel must be entered at the beginning of the kernel image. The existing
ENTRY()command defined the symbol stext as the entry point, which emitted an incorrect entry point, but would not cause a runtime error because the existing entry code immediately jumps to stext.
Quoted 6 lines
Signed-off-by Geoff Levand <[email protected]>---
Hi Will,As requested, here is a fix for the linker script. There are a lot of ways we can define the entry point. Let me know if you want to do it differently.
Looks good to me, thanks:
Will
Quoted 22 lines
arch/arm64/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm64/kernel/vmlinux.lds.S +1
-1@@ -13,7 +13,7 @@ #define ARM_EXIT_DISCARD(x) x OUTPUT_ARCH(aarch64) -ENTRY(stext) +ENTRY(_text) jiffies = jiffies_64;Signature · 1 line
1.9.1