At the moment, the earlyprintk messages are interleaved with the
instructions. This makes more difficult to read the objdump output.
Introduce a new macro to add a string in .rodata.str and use it for all
the earlyprintk messages.
Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Andrii Anisov <andrii_anisov@epam.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
/* Macro to print a string to the UART, if there is one.
* Clobbers x0-x3. */
#ifdef CONFIG_EARLY_PRINTK
-#define PRINT(_s) \
- adr x0, 98f ; \
- bl puts ; \
- b 99f ; \
-98: .asciz _s ; \
- .align 2 ; \
-99:
+#define PRINT(_s) \
+ adr x0, 98f ; \
+ bl puts ; \
+ RODATA_STR(98, _s)
#else /* CONFIG_EARLY_PRINTK */
#define PRINT(s)
#endif /* !CONFIG_EARLY_PRINTK */
#endif
adr x0, 1f
b puts
-1: .asciz "- UART enabled -\r\n"
- .align 4
+RODATA_STR(1, "- UART enabled -\r\n")
/* Print early debug messages.
* x0: Nul-terminated string to print.
# error "unknown ARM variant"
#endif
+#define RODATA_STR(label, msg) \
+.pushsection .rodata.str, "aMS", %progbits, 1 ; \
+label: .asciz msg; \
+.popsection
+
#endif /* __ARM_ASM_DEFNS_H__ */
/*
* Local variables: