/* panic() if xtf_main manages to return. */
#ifdef __x86_64__
- lea main_err_msg(%rip), %rdi
+ lea .Lmain_err_msg(%rip), %rdi
#else
- push $main_err_msg
+ push $.Lmain_err_msg
#endif
call panic
ENDFUNC(_start)
-.section .rodata.str1, "aMS", @progbits, 1
-
-main_err_msg: .asciz "xtf_main() returned\n"
-SIZE(main_err_msg)
+DECLSTR(.Lmain_err_msg, "xtf_main() returned\n")
/*
* Local variables:
/* panic() if xtf_main manages to return. */
#ifdef __x86_64__
- lea main_err_msg(%rip), %rdi
+ lea .Lmain_err_msg(%rip), %rdi
#else
- push $main_err_msg
+ push $.Lmain_err_msg
#endif
call panic
ENDFUNC(_start)
-.section .rodata.str1, "aMS", @progbits, 1
-
-main_err_msg: .asciz "xtf_main() returned\n"
-SIZE(main_err_msg)
+DECLSTR(.Lmain_err_msg, "xtf_main() returned\n")
/*
* Local variables:
.type name, STT_FUNC; \
SIZE(name)
+/**
+ * Declare a string with label @p name and value @p val. It is placed in the
+ * mergable string section, is declared as data, and has its size set.
+ * @param name String name.
+ * @param val String content.
+ */
+#define DECLSTR(name, val) \
+ .pushsection .rodata.str1, "aMS", @progbits, 1; \
+ name: .asciz val; \
+ .type name, STT_OBJECT; \
+ SIZE(name) \
+ .popsection
+
/**
* Create an ELF note entry.
*