diff --git a/btf_encoder.c b/btf_encoder.c index b920a77..2e705f8 100644 --- a/btf_encoder.c +++ b/btf_encoder.c @@ -1322,7 +1322,7 @@ struct btf_encoder *btf_encoder__new(struct cu *cu, const char *detached_filenam /* find percpu section's shndx */ GElf_Shdr shdr; - Elf_Scn *sec = elf_section_by_name(cu->elf, &encoder->ehdr, &shdr, PERCPU_SECTION, NULL); + Elf_Scn *sec = elf_section_by_name(cu->elf, &shdr, PERCPU_SECTION, NULL); if (!sec) { if (encoder->verbose) diff --git a/ctracer.c b/ctracer.c index 0a02865..fa20cb8 100644 --- a/ctracer.c +++ b/ctracer.c @@ -830,8 +830,7 @@ static int elf__open(const char *filename) GElf_Shdr shdr; size_t init_index; - Elf_Scn *init = elf_section_by_name(elf, &ehdr, &shdr, ".init.text", - &init_index); + Elf_Scn *init = elf_section_by_name(elf, &shdr, ".init.text", &init_index); if (init == NULL) goto out_elf_end; diff --git a/dutil.c b/dutil.c index b7bbc9d..97c4474 100644 --- a/dutil.c +++ b/dutil.c @@ -180,8 +180,7 @@ bool strlist__has_entry(struct strlist *slist, const char *entry) return false; } -Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, - GElf_Shdr *shp, const char *name, size_t *index) +Elf_Scn *elf_section_by_name(Elf *elf, GElf_Shdr *shp, const char *name, size_t *index) { Elf_Scn *sec = NULL; size_t cnt = 1; diff --git a/dutil.h b/dutil.h index 7e3bf55..77f2a39 100644 --- a/dutil.h +++ b/dutil.h @@ -321,8 +321,7 @@ static inline bool strstarts(const char *str, const char *prefix) void *zalloc(const size_t size); -Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, - GElf_Shdr *shp, const char *name, size_t *index); +Elf_Scn *elf_section_by_name(Elf *elf, GElf_Shdr *shp, const char *name, size_t *index); Elf_Scn *elf_section_by_idx(Elf *elf, GElf_Shdr *shp, int idx); diff --git a/dwarves.c b/dwarves.c index ac3596b..a54a2c0 100644 --- a/dwarves.c +++ b/dwarves.c @@ -2142,18 +2142,15 @@ static int elf_read_build_id(Elf *elf, void *bf, size_t size) * '.note' (VDSO specific) */ do { - sec = elf_section_by_name(elf, &ehdr, &shdr, - ".note.gnu.build-id", NULL); + sec = elf_section_by_name(elf, &shdr, ".note.gnu.build-id", NULL); if (sec) break; - sec = elf_section_by_name(elf, &ehdr, &shdr, - ".notes", NULL); + sec = elf_section_by_name(elf, &shdr, ".notes", NULL); if (sec) break; - sec = elf_section_by_name(elf, &ehdr, &shdr, - ".note", NULL); + sec = elf_section_by_name(elf, &shdr, ".note", NULL); if (sec) break; diff --git a/elf_symtab.c b/elf_symtab.c index 7ba40fc..3fbab31 100644 --- a/elf_symtab.c +++ b/elf_symtab.c @@ -23,7 +23,7 @@ struct elf_symtab *elf_symtab__new(const char *name, Elf *elf, GElf_Ehdr *ehdr) name = ".symtab"; GElf_Shdr shdr; - Elf_Scn *sec = elf_section_by_name(elf, ehdr, &shdr, name, &symtab_index); + Elf_Scn *sec = elf_section_by_name(elf, &shdr, name, &symtab_index); if (sec == NULL) return NULL; diff --git a/libctf.c b/libctf.c index cb12bb4..6cb84dc 100644 --- a/libctf.c +++ b/libctf.c @@ -132,8 +132,7 @@ int ctf__load(struct ctf *ctf) { int err = -ENOTSUP; GElf_Shdr shdr; - Elf_Scn *sec = elf_section_by_name(ctf->elf, &ctf->ehdr, - &shdr, ".SUNW_ctf", NULL); + Elf_Scn *sec = elf_section_by_name(ctf->elf, &shdr, ".SUNW_ctf", NULL); if (sec == NULL) return -ESRCH;