At the moment, the 'hex' string is placed right after the 'putn'
function in the .text section. This is because of the limited range
(+/- 1MB) of PC relative 'adr' instruction 'putn' uses. Modify it to use
'adr_l' instead (range extended to +/- 4GB) and move the string to
.rodata.str. This way all the earlyprintk messages will be part of .rodata
and the behavior will be consistent with what we already do on arm32.

Signed-off-by: Michal Orzel <michal.or...@amd.com>
---
 xen/arch/arm/arm64/head.S | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 8dbd3300d89f..b6111399e766 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -498,7 +498,7 @@ ENDPROC(asm_puts)
  * Clobbers x0-x3
  */
 putn:
-        adr   x1, hex
+        adr_l x1, hex
         mov   x3, #16
 1:
         early_uart_ready x23, 2
@@ -512,8 +512,7 @@ putn:
         ret
 ENDPROC(putn)
 
-hex:    .ascii "0123456789abcdef"
-        .align 2
+RODATA_STR(hex, "0123456789abcdef")
 
 #else  /* CONFIG_EARLY_PRINTK */
 
-- 
2.25.1


Reply via email to