Files
ares/libco
invertego cc4db18707 libco: limit scope of section hack to gcc
When placing co_swap_function byte array into the text section, libco
uses the trick of appending a # to the section name. This name string is
passed directly to the generated assembly and the # is treated as
comment token by the GNU assembler. This is a hack to avoid a warning
about changed section attributes.

This hack doesn't work with other compilers like Clang or TinyCC, but
unlike GCC they don't require such hacks. I've added some compile time
checks around the hack to try to isolate it to GCC and allow other
compilers to see the unmodified section name.

Validated on the following OSes/architectures/compilers:
- Windows/amd64: gcc, clang, cl, clang-cl, tcc
- Windows/aarch64: clang, cl, clang-cl
- Linux/amd64: gcc, clang, tcc[1]
- Linux/aarch64: gcc, clang, tcc[1]
- macOS/aarch64: gcc, clang

[1] TCC only works with a fix to glibc headers that was only made very
recently. Without it, you have to #undef __attribute__ after including
glibc headers.
2025-12-29 12:01:33 +00:00
..
2019-12-02 19:45:14 +09:00
2020-03-24 19:06:00 +00:00
2021-02-26 19:33:00 +00:00
2022-11-15 16:06:55 +00:00
2020-03-24 19:06:00 +00:00
2020-03-24 19:06:00 +00:00
2020-03-24 19:06:00 +00:00
2023-03-13 15:38:39 +00:00