I have some code that looks like this:
__attribute__((section("__DATA,__mysection"))) char *mumble;
...
mumble = GC_MALLOC(100);
...
I'm using the Boehm garbage collector. I would expect the data that mumble points to to be safe, since it's still live. But in fact, it is collected and reused. I checked GC_print_static_roots(): it appears that the entire __mysection section is not contained in any of the roots.
(I did find a solution to this -- but does anyone have any simpler ideas?)