base/asm-common.h, symm/rijndael-x86ish-aesni.S: Better section switching.
[catacomb] / base / asm-common.h
index 946f860..e5e0f2f 100644 (file)
 #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);                                                \