-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Labels
enhancementNew feature or requestNew feature or requestfreebsd😈 FreeBSD support😈 FreeBSD supporthelp wantedExtra attention is neededExtra attention is neededless-c++🐀 Work to reduce the size of our C++ codebase and/or dependencies🐀 Work to reduce the size of our C++ codebase and/or dependencieslinux🐧 Linux support (all distros)🐧 Linux support (all distros)qnx🫐 QNX support🫐 QNX support
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));
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestfreebsd😈 FreeBSD support😈 FreeBSD supporthelp wantedExtra attention is neededExtra attention is neededless-c++🐀 Work to reduce the size of our C++ codebase and/or dependencies🐀 Work to reduce the size of our C++ codebase and/or dependencieslinux🐧 Linux support (all distros)🐧 Linux support (all distros)qnx🫐 QNX support🫐 QNX support