Provide macros for changing section which handle (a) switching to the
right text subsection, and (b) a section for readonly data.
#define _ENDLIT .text .L$_subsec
#define _LTORG .L$_subsec = .L$_subsec + 2; .text .L$_subsec
#define _ENDLIT .text .L$_subsec
#define _LTORG .L$_subsec = .L$_subsec + 2; .text .L$_subsec
+// ELF section types.
+#if __ELF__
+# if CPUFAM_ARMEL
+# define _SECTTY(ty) %ty
+# else
+# define _SECTTY(ty) @ty
+# endif
+#endif
+
+// Section selection.
+#define TEXT .text .L$_subsec
+#if ABI_WIN
+# define RODATA .section .rdata, "dr"
+#elif __ELF__
+# define RODATA .section .rodata, "a", _SECTTY(progbits)
+#else
+# define RODATA TEXT
+#endif
+#define DATA .data
+
// Announcing an external function.
#define FUNC(name) \
.globl F(name); \
// Announcing an external function.
#define FUNC(name) \
.globl F(name); \
///--------------------------------------------------------------------------
/// Data tables.
///--------------------------------------------------------------------------
/// Data tables.
.align 16
endswap_tab:
.byte 3, 2, 1, 0
.align 16
endswap_tab:
.byte 3, 2, 1, 0