Skip to content

Commit

Permalink
Parse objects with unknown section to give better errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
dillof committed Aug 22, 2024
1 parent 1cd5807 commit 6e67b70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ObjectFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ const Object* ObjectFile::object(Symbol object_name) const {
Object* ObjectFile::create_object(Symbol section_name, Visibility visibility, bool default_only, const Token& object_name) {
auto section = target->map.section(section_name);
if (section == nullptr) {
throw ParseException(object_name, "unknown section '%s'", section_name.c_str());
FileReader::global.error(object_name.location, "unknown section '%s'", section_name.c_str());
// TODO: mark object as faulty
}
return insert_object(std::make_unique<Object>(this, section, visibility, default_only, object_name));
}
Expand Down

0 comments on commit 6e67b70

Please sign in to comment.