ElfFileResolveAddress
Description
Look up the symbol whose [value, value+size) range contains vaddr. Searches symbols first, then dynamic_symbols — so static (non-exported) functions resolve when .symtab is present.
vaddr is the file-relative virtual address — i.e. for a runtime pointer in a ET_DYN (PIE / shared object), the caller subtracts the load base first. For ET_EXEC it’s the address as-is.
Parameters
| Name | Direction | Description |
|---|---|---|
self |
in | Parsed ELF file. |
vaddr |
in | Virtual address to resolve. |
Success
Returns a pointer to the matching ElfSymbol. The pointer is valid until ElfFileDeinit.
Failure
Returns NULL if no symbol covers vaddr.
Usage example (Cross-references)
Usage examples (Cross-references)
u64 file_relative = addr - load_base;
const ElfSymbol *sym = ElfFileResolveAddress(&cache_entry->elf, file_relative);
if (sym && sym->name && sym->name[0]) {
out->symbol_name = sym->name;- In
Elf.c:404:
}
const ElfSymbol *ElfFileResolveAddress(const ElfFile *self, u64 vaddr) {
if (!self)
return NULL;
Last updated on