chiark / gitweb /
base/asm-common.h, symm/rijndael-x86ish-aesni.S: Better section switching.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 12 Sep 2016 21:32:37 +0000 (22:32 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 3 Apr 2017 08:55:46 +0000 (09:55 +0100)
Provide macros for changing section which handle (a) switching to the
right text subsection, and (b) a section for readonly data.

base/asm-common.h
symm/rijndael-x86ish-aesni.S

index 946f860884516eb50f07ee36e0e622a14b41c7fc..e5e0f2f247d6aa6f6b45e2cd14b7a22a3c4c57ef 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);                                                \
index 5293d12eaf68465fc8a52dbfa79db382eb6ee8b7..3cca50f7df5bb2888c74d85ce988a964d96f8832 100644 (file)
@@ -545,6 +545,8 @@ bogus:      callext F(abort)
 ///--------------------------------------------------------------------------
 /// Data tables.
 
+       RODATA
+
        .align  16
 endswap_tab:
        .byte    3,  2,  1,  0