Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lld/MachO/InputFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,11 @@ void ObjFile::parseSymbols(ArrayRef<typename LP::section> sectionHeaders,
continue;

if ((sym.n_type & N_TYPE) == N_SECT) {
if (sym.n_sect == 0) {
error("Section symbol " + StringRef(strtab + sym.n_strx) + " in " +
toString(this) + " has an invalid section index of 0");
llvm_unreachable("Section symbol without an associated section.");
}
Subsections &subsections = sections[sym.n_sect - 1]->subsections;
// parseSections() may have chosen not to parse this section.
if (subsections.empty())
Expand Down