Skip to content
Open
Changes from all commits
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
20 changes: 18 additions & 2 deletions ps2xRecomp/src/lib/function_table_emitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,25 @@ namespace ps2recomp
}
if (entryTarget.empty())
{
throw std::runtime_error("No entry function name available for registration.");
// Not every toolchain points e_entry at code. Metrowerks CodeWarrior
// for PS2 emits a crt0 data table there, so no function covers the
// address and no name resolves. Registering a synthesized name would
// reference a definition that was never emitted, so skip the entry
// instead - the real start address comes from configuration - and
// keep emitting the rest of the table rather than aborting after the
// per-function sources were already written.
if (cg.m_reporter)
{
std::ostringstream oss;
oss << "No function covers the ELF entry point; skipping its table registration. "
<< "Set the entry explicitly if the runtime should start here.";
cg.m_reporter->warning("function-table", oss.str());
}
}
else
{
addEntry(cg.m_bootstrapInfo.entry, entryTarget);
}
addEntry(cg.m_bootstrapInfo.entry, entryTarget);
}

for (const auto &[address, name] : normalFunctions)
Expand Down