X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/f2fb936ad489269da59b7250d4aeacec1779dc97..981a9e5d5e3af6c06ad8b3f821928852068227e4:/base/asm-common.h diff --git a/base/asm-common.h b/base/asm-common.h index 36876248..9257d762 100644 --- a/base/asm-common.h +++ b/base/asm-common.h @@ -45,15 +45,6 @@ #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 - // Announcing an internal function. #define INTFUNC(name) \ TYPE_FUNC(name); \ @@ -95,6 +86,13 @@ name: #if __ELF__ +// Section types. +#if CPUFAM_ARMEL +# define _SECTTY(ty) %ty +#else +# define _SECTTY(ty) @ty +#endif + // Section selection. #define RODATA .section .rodata, "a", _SECTTY(progbits) @@ -108,6 +106,12 @@ name: # define WANT_PIC 1 #endif +// Don't make the stack executable by default. +#ifndef FORCE_EXECUTABLE_STACK + .pushsection .note.GNU-stack, "", _SECTTY(progbits) + .popsection +#endif + #endif ///-------------------------------------------------------------------------- @@ -218,11 +222,11 @@ name: # define INTADDR__1(addr, got) addr #endif -// Permutations for SIMD instructions. SHUF(A, B, C, D) is an immediate, +// Permutations for SIMD instructions. SHUF(D, C, B, A) is an immediate, // suitable for use in `pshufd' or `shufpd', which copies element A // (0 <= A < 4) of the source to element 0 of the destination, element B to // element 1, element C to element 2, and element D to element 3. -#define SHUF(a, b, c, d) ((a) + 4*(b) + 16*(c) + 64*(d)) +#define SHUF(d, c, b, a) (64*(d) + 16*(c) + 4*(b) + (a)) // Map register names to their individual pieces. @@ -1211,11 +1215,6 @@ name: # define SIZE_OBJ(name) #endif -#if __ELF__ && !defined(FORCE_EXECUTABLE_STACK) - .pushsection .note.GNU-stack, "", _SECTTY(progbits) - .popsection -#endif - ///----- That's all, folks -------------------------------------------------- #endif