Open
Description
Currently, on ELF only, we need to call an internal runtime function swift_enumerateAllMetadataSections()
in order to find sections that contain our metadata. That's because ELF binaries generally don't preserve section header information. I'd love for our platform-specific implementation to look like:
template <typename SectionEnumerator>
static void enumerateTypeMetadataSections(const SectionEnumerator& body) {
dl_iterate_phdr([] (struct dl_phdr_info *info, size_t size, void *context) -> int {
const SectionEnumerator& body = *reinterpret_cast<SectionEnumerator *>(context);
bool stop = false;
if (auto sb = /* ??? */(info)) {
body(sb, &stop);
}
return stop;
}, const_cast<SectionEnumerator *>(&body));
}