btf_encoder: No need to read the ehdr in btf_encoder__write_elf(), ditch it

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2021-08-05 16:15:06 -03:00
parent 898cc49027
commit 9fbfcee7d9
1 changed files with 0 additions and 7 deletions

View File

@ -905,7 +905,6 @@ static int btf_encoder__write_elf(struct btf_encoder *encoder)
struct btf *btf = encoder->btf;
const char *filename = encoder->filename;
GElf_Shdr shdr_mem, *shdr;
GElf_Ehdr ehdr_mem, *ehdr;
Elf_Data *btf_data = NULL;
Elf_Scn *scn = NULL;
Elf *elf = NULL;
@ -933,12 +932,6 @@ static int btf_encoder__write_elf(struct btf_encoder *encoder)
elf_flagelf(elf, ELF_C_SET, ELF_F_DIRTY);
ehdr = gelf_getehdr(elf, &ehdr_mem);
if (ehdr == NULL) {
elf_error("elf_getehdr failed");
goto out;
}
/*
* First we look if there was already a .BTF section to overwrite.
*/