diff --git a/runtime/vm/dwarf.cc b/runtime/vm/dwarf.cc index be78898f89e..c70ed6ae9be 100644 --- a/runtime/vm/dwarf.cc +++ b/runtime/vm/dwarf.cc @@ -124,7 +124,8 @@ void Dwarf::AddCode(const Code& code, ASSERT(name != nullptr); ASSERT(payload_start >= 0); auto const virtual_address = elf_->NextMemoryOffset() + payload_start; - elf_->AddStaticSymbol(elf_->NextSectionIndex(), name, virtual_address); + elf_->AddStaticSymbol(elf_->NextSectionIndex(), name, virtual_address, + code.Size()); ASSERT(!code.IsNull()); ASSERT(code_to_address_.Lookup(&code) == nullptr); diff --git a/runtime/vm/elf.cc b/runtime/vm/elf.cc index 60e9b6282d2..e3f3bd0677e 100644 --- a/runtime/vm/elf.cc +++ b/runtime/vm/elf.cc @@ -650,7 +650,8 @@ intptr_t Elf::AddText(const char* name, const uint8_t* bytes, intptr_t size) { void Elf::AddStaticSymbol(intptr_t section, const char* name, - size_t memory_offset) { + intptr_t address, + intptr_t size) { // Lazily allocate the static string and symbol tables, as we only add static // symbols in unstripped ELF files. if (strtab_ == nullptr) { @@ -661,8 +662,8 @@ void Elf::AddStaticSymbol(intptr_t section, auto const name_index = strtab_->AddString(name); auto const info = (elf::STB_GLOBAL << 4) | elf::STT_FUNC; - Symbol* symbol = new (zone_) - Symbol(name, name_index, info, section, memory_offset, /*size=*/0); + Symbol* symbol = + new (zone_) Symbol(name, name_index, info, section, address, size); symtab_->AddSymbol(symbol); } diff --git a/runtime/vm/elf.h b/runtime/vm/elf.h index f270dacde84..4cd877a5514 100644 --- a/runtime/vm/elf.h +++ b/runtime/vm/elf.h @@ -33,7 +33,8 @@ class Elf : public ZoneAllocated { void AddDebug(const char* name, const uint8_t* bytes, intptr_t size); void AddStaticSymbol(intptr_t section, const char* name, - size_t memory_offset); + intptr_t address, + intptr_t size); void Finalize();