Support procedure calls without arguments

This commit is contained in:
2024-03-26 23:04:20 +01:00
parent 30f80bcb88
commit 12869f0ec7
13 changed files with 317 additions and 113 deletions

View File

@ -146,7 +146,8 @@ namespace elna::riscv
return -1;
}
void riscv32_elf(source::program *ast, const std::filesystem::path& out_file)
void riscv32_elf(source::program *ast, std::shared_ptr<source::symbol_table> table,
const std::filesystem::path& out_file)
{
ELFIO::elfio writer;
@ -197,7 +198,7 @@ namespace elna::riscv
ELFIO::relocation_section_accessor rela(writer, rel_sec);
auto _writer = std::make_shared<elfio_writer>(text_sec, ro_sec, syma, stra);
visitor _visitor{ _writer };
visitor _visitor{ _writer, table };
_visitor.visit(ast);
syma.arrange_local_symbols();