From 5b86194734d4021158312898e9e6e403cbbb7480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Wed, 4 Jan 2023 14:53:25 +0100 Subject: [PATCH] Remove reading of program headers. It is not necessary. --- src/elfpatch.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/elfpatch.c b/src/elfpatch.c index e1f7ef1..390284f 100644 --- a/src/elfpatch.c +++ b/src/elfpatch.c @@ -232,9 +232,6 @@ static int elf_patch_update_info(elfpatch_handle_t *ep) { Elf_Kind ek; const char *type_string = "unrecognized"; - size_t header_count = 0ull; - GElf_Phdr phdr; - size_t i; ret_val_if_ep_err(ep, -1001); @@ -276,20 +273,6 @@ static int elf_patch_update_info(elfpatch_handle_t *ep) return -1; } - /* Get program headers */ - if ( elf_getphdrnum(ep->elf, &header_count) != 0) { - print_err("Error reading count of program headers: %s\n", elf_errmsg(-1)); - return -1; - } - - for (i = 0ull; i < header_count; i++) { - if (gelf_getphdr(ep->elf, (int)i, &phdr) != &phdr) { - print_err("Error reading program header (%zu): %s\n", i, elf_errmsg(-1)); - return -1; - } - print_debug("Read program header %zu\n", i); - } - return 0; }