// .debug sections. We don't support it yet. Let's discard .debug sections at
// the very beginning of the process so that we don't spend time on linking
// blobs that nobody would understand.
- if (sectionName == ".debug" || sectionName.startswith(".debug$"))
+ if ((section->Characteristics & llvm::COFF::IMAGE_SCN_MEM_DISCARDABLE) &&
+ (sectionName == ".debug" || sectionName.startswith(".debug$"))) {
return error_code::success();
+ }
DefinedAtom::ContentType type = getContentType(section);
DefinedAtom::ContentPermissions perms = getPermissions(section);