[vm] Add sizes to ELF static symbols for Code payloads.
Change-Id: I7868ec621e08773b7d379e95fe091e820bf29c94 Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139807 Reviewed-by: Daco Harkes <dacoharkes@google.com> Commit-Queue: Teagan Strickland <sstrickl@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
9a640dfe51
commit
5f8802b82f
+2
-1
@@ -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);
|
||||
|
||||
+4
-3
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user