chiark / gitweb /
base/asm-common.h: Introduce bad literal-pool handling macros.
[catacomb] / base / asm-common.h
index 28ddd0d1893119d62aee65bca6fd1f211029a427..aa6b4c3e40696794d60b255bb1a110c4158d7b49 100644 (file)
 ///--------------------------------------------------------------------------
 /// General definitions.
 
+// Some useful variables.
+       .L$_subsec = 0
+
+// Literal pools done the hard way.
+#define _LIT .text .L$_subsec + 1
+#define _ENDLIT .text .L$_subsec
+
 // Announcing an external function.
 #define FUNC(name)                                                     \
        .globl  F(name);                                                \
@@ -40,7 +47,9 @@ F(name):                                                              \
 #define _ENDFUNC(name)                                                 \
        .purgem ENDFUNC;                                                \
        SIZE_OBJ(name);                                                 \
-       ENDFUNC_HOOK(name)
+       ENDFUNC_HOOK(name);                                             \
+       .L$_subsec = .L$_subsec + 2;                                    \
+       .text .L$_subsec
 
 ///--------------------------------------------------------------------------
 /// ELF-specific hacking.