Is it possible to read own symbol name by it's address using some API, when we assume that the whole program (and all related .so-files) has been deleted ?
I found some pieces how to get this information using objdump
, readelf
, nm
etc., but are not an option.
What I'd like to have is a function string get_symbol_at(uint64_t addr)
.
The static/debug symbols in ELF-files are encoded in DWARF
-format. They can be discovered via analyzing debug information. However, all .debug_*
sections seems are simply not loaded by Operating system (see), because they are quite big and useless for the program execution (they become useful only when program is debugged).
So, the answer is: when debug symbols are needed the executable have to be read from disk via own forces.