Skip to contentSkip to conversation

arm64 entry point

PATCH New Geoff Levand 2 participants 4 messages May 15, 2014 – May 19, 2014 arm64

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
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

#2 lore raw

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
index 4ba7a55..f1e6d5c 100644
@@ -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
#3 lore raw

PATCH 1/1 arm64: Fix linker script entry point

Quoted 9 lines · Geoff Levand

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.

Quoted 6 lines

---
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
index 4ba7a55..f1e6d5c 100644
@@ -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