2 ms·
Good question. https://github.com/byuu/bsnes/blob/bd8e94a7c7cbfdf7ac0b7f24ce06fa219e7e5974/libco/settings.h#L3-L6 https://github.com/byuu/bsnes/blob/bd8e94a7c7c
by lilyball 7y ago
Good question. https://github.com/byuu/bsnes/blob/bd8e94a7c7cbfdf7ac0b7f24ce06fa219e7e5974/libco/settings.h#L3-L6 https://github.com/byuu/bsnes/blob/bd8e94a7c7cbfdf7ac0b7f24c... suggests there are reasons why the section(text) approach might not work, and https://github.com/byuu/bsnes/blob/6b7e6e01bb025bf5cbeb92e65a492121070fb996/libco/libco.c#L1-L7 https://github.com/byuu/bsnes/blob/6b7e6e01bb025bf5cbeb92e65... explicitly says it doesn't work with clang, though I don't see why there's not some way of solving this without mprotect that works everywhere.
- gpderetta 7y agobut why is it not simply using a separate asm file instead of embedding the preassembled binary as a constant?
- byuu 7y agoBecause for many years libco has supported all C89 compilers. I didn't want a dependency on GNU as on Windows, nor did I want to write an MSVC variant. There is no technical reason it cannot be inline now, especially now that we have Clang with a compatible asm syntax.