diff --git a/include/mtl/target.hpp b/include/mtl/target.hpp index e0bf50a..ea3d4a3 100644 --- a/include/mtl/target.hpp +++ b/include/mtl/target.hpp @@ -27,6 +27,11 @@ #ifdef __GBA__ +// If a section attribute is used, the symbol will be placed in the section +// exactly as specified. This means that when -ffunction-sections is used, functions +// will no longer be placed in separate sections. This macro is used to mimic +// the effect of -ffunction-sections while still placing the function in IWRAM. +#define GBA_IWRAM_FUNC(f) [[gnu::section(".iwram." #f), gnu::long_call]] #define GBA_IWRAM [[gnu::section(".iwram"), gnu::long_call]] #define GBA_EWRAM [[gnu::section(".ewram"), gnu::long_call]] #define GBA_IWRAM_DATA [[gnu::section(".iwram")]]