Symbol table

This commit is contained in:
Sajid
2024-09-08 08:32:31 +06:00
parent 36fb31de3a
commit 6d79935928
8 changed files with 186 additions and 48 deletions

View File

@@ -4,9 +4,15 @@
int main()
{
// TODO: ELFs, symbols, sections, a lot
const auto file = LoadFile("add.elf");
const auto image = Image::ParseImage(file.data(), file.size()).value();
auto image = Image::ParseImage(file.data(), file.size()).value();
for (const auto& section : image.sections)
{
image.symbols.emplace(section.name, section.base, section.size, Symbol_Section);
}
image.symbols.emplace("_start", image.entry_point, 0x30, Symbol_Function);
for (const auto& section : image.sections)
{
@@ -17,8 +23,6 @@ int main()
auto base = section.base;
const auto end = section.base + section.size;
ppc::SetDetail(true);
if (section.flags & SectionFlags_Code)
{
while(base < end)