From: Mark Wooding Date: Mon, 12 Sep 2016 21:32:37 +0000 (+0100) Subject: base/asm-common.h, symm/rijndael-x86ish-aesni.S: Better section switching. X-Git-Tag: 2.3.0~24 X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/commitdiff_plain/645fcce0830342b644cc16e71e28790c838d9415 base/asm-common.h, symm/rijndael-x86ish-aesni.S: Better section switching. Provide macros for changing section which handle (a) switching to the right text subsection, and (b) a section for readonly data. --- diff --git a/base/asm-common.h b/base/asm-common.h index 946f8608..e5e0f2f2 100644 --- a/base/asm-common.h +++ b/base/asm-common.h @@ -35,6 +35,26 @@ #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); \ diff --git a/symm/rijndael-x86ish-aesni.S b/symm/rijndael-x86ish-aesni.S index 5293d12e..3cca50f7 100644 --- a/symm/rijndael-x86ish-aesni.S +++ b/symm/rijndael-x86ish-aesni.S @@ -545,6 +545,8 @@ bogus: callext F(abort) ///-------------------------------------------------------------------------- /// Data tables. + RODATA + .align 16 endswap_tab: .byte 3, 2, 1, 0