From 89bd699837ed5519b19c5ff7a0bc6fd892de416d Mon Sep 17 00:00:00 2001 From: David Guillen Fandos Date: Fri, 5 Mar 2021 01:14:31 +0100 Subject: Reduce executable size by 90% Turns out most of that file ends up in JIT section, which is RWX and not a very nice way to run code really (security issues aside). This also makes possible to build that file with -ggdb otherwise it complains about stuff. --- cpu_threaded.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpu_threaded.c b/cpu_threaded.c index 083c027..c7b8850 100644 --- a/cpu_threaded.c +++ b/cpu_threaded.c @@ -54,7 +54,7 @@ u8 *rom_translation_ptr = rom_translation_cache; u8 *ram_translation_ptr = ram_translation_cache; u8 *bios_translation_ptr = bios_translation_cache; #elif defined(ARM_MEMORY_DYNAREC) -__asm__(".section .jit,\"awx\",%progbits"); +__asm__(".section .jit,\"awx\",%nobits"); u8 rom_translation_cache[ROM_TRANSLATION_CACHE_SIZE] __attribute__ ((aligned(4),section(".jit"))); @@ -67,6 +67,8 @@ u8 *ram_translation_ptr = ram_translation_cache; u8 bios_translation_cache[BIOS_TRANSLATION_CACHE_SIZE] __attribute__ ((aligned(4),section(".jit"))); u8 *bios_translation_ptr = bios_translation_cache; + +__asm__(".section .text"); #else u8 rom_translation_cache[ROM_TRANSLATION_CACHE_SIZE]; u8 ram_translation_cache[RAM_TRANSLATION_CACHE_SIZE]; -- cgit v1.2.3