And how do we get the TLS initialization data? If we placed it into an array, like DMD does on OSX, we could use dlsym for dlopened libraries, but what about initially loaded libraries?
That doesn't work because the symbols would collide. If you made them local symbols OTOH you can't access them through dlsym. Use dl_iterate_phdr to get the initial image.