| 358 | } |
| 359 | |
| 360 | [[nodiscard]] |
| 361 | static inline const Elf32_Phdr *findSegmentByType32(const ElfView::ElfInfo &info, Elf32_Word type) { |
| 362 | const Elf32_Phdr *target = nullptr; |
| 363 | const auto *phdr = (const Elf32_Phdr *) info.phdr; |
| 364 | for (int i = 0; i < ((const Elf32_Ehdr *) info.ehdr)->e_phnum; i++) { |
| 365 | if (phdr[i].p_type == type) { |
| 366 | target = phdr + i; |
| 367 | break; |
| 368 | } |
| 369 | } |
| 370 | return target; |
| 371 | } |
| 372 | |
| 373 | [[nodiscard]] |
| 374 | static inline const Elf64_Phdr *findSegmentByType64(const ElfView::ElfInfo &info, Elf64_Word type) { |
no outgoing calls
no test coverage detected