| 396 | } |
| 397 | |
| 398 | static StatusCode |
| 399 | parseCoreExecfn(const NoteData& note_data, uintptr_t* result) |
| 400 | { |
| 401 | const size_t auxv_size = gelf_fsize(note_data.elf, ELF_T_AUXV, 1, EV_CURRENT); |
| 402 | assert(auxv_size > 0); |
| 403 | const size_t nauxv = note_data.descriptor_size / auxv_size; |
| 404 | for (size_t i = 0; i < nauxv; ++i) { |
| 405 | GElf_auxv_t av_mem; |
| 406 | const GElf_auxv_t* av = gelf_getauxv(note_data.data, i, &av_mem); |
| 407 | if (!av || av->a_type != AT_EXECFN) { |
| 408 | continue; |
| 409 | } |
| 410 | *result = static_cast<uintptr_t>(av->a_un.a_val); |
| 411 | return StatusCode::SUCCESS; |
| 412 | } |
| 413 | return StatusCode::ERROR; |
| 414 | } |
| 415 | |
| 416 | uintptr_t |
| 417 | CoreFileExtractor::findExecFn() const |