Skip to content

Commit

Permalink
elf_symtab: Remove needless GElf_Ehdr pointer argument from the const…
Browse files Browse the repository at this point in the history
…ructor

We don't need it as we used it only for calling elf_section_by_name(),
that doesn't need it anymore.

Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed Aug 20, 2021
1 parent 74c2078 commit 2440419
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion btf_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ struct btf_encoder *btf_encoder__new(struct cu *cu, const char *detached_filenam
goto out_delete;
}

encoder->symtab = elf_symtab__new(NULL, cu->elf, &encoder->ehdr);
encoder->symtab = elf_symtab__new(NULL, cu->elf);
if (!encoder->symtab) {
if (encoder->verbose)
printf("%s: '%s' doesn't have symtab.\n", __func__, cu->filename);
Expand Down
2 changes: 1 addition & 1 deletion ctracer.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ static int elf__open(const char *filename)
if (init == NULL)
goto out_elf_end;

struct elf_symtab *symtab = elf_symtab__new(".symtab", elf, &ehdr);
struct elf_symtab *symtab = elf_symtab__new(".symtab", elf);
if (symtab == NULL)
goto out_elf_end;

Expand Down
2 changes: 1 addition & 1 deletion elf_symtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define HASHSYMS__BITS 8
#define HASHSYMS__SIZE (1UL << HASHSYMS__BITS)

struct elf_symtab *elf_symtab__new(const char *name, Elf *elf, GElf_Ehdr *ehdr)
struct elf_symtab *elf_symtab__new(const char *name, Elf *elf)
{
size_t symtab_index;

Expand Down
2 changes: 1 addition & 1 deletion elf_symtab.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct elf_symtab {
char *name;
};

struct elf_symtab *elf_symtab__new(const char *name, Elf *elf, GElf_Ehdr *ehdr);
struct elf_symtab *elf_symtab__new(const char *name, Elf *elf);
void elf_symtab__delete(struct elf_symtab *symtab);

static inline uint32_t elf_symtab__nr_symbols(const struct elf_symtab *symtab)
Expand Down
2 changes: 1 addition & 1 deletion libctf.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ size_t ctf__get_size(struct ctf *ctf)

int ctf__load_symtab(struct ctf *ctf)
{
ctf->symtab = elf_symtab__new(".symtab", ctf->elf, &ctf->ehdr);
ctf->symtab = elf_symtab__new(".symtab", ctf->elf);
return ctf->symtab == NULL ? -1 : 0;
}

Expand Down
2 changes: 1 addition & 1 deletion pfunct.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ int elf_symtab__show(char *filename)
goto out_elf_end;
}

struct elf_symtab *symtab = elf_symtab__new(symtab_name, elf, &ehdr);
struct elf_symtab *symtab = elf_symtab__new(symtab_name, elf);
if (symtab == NULL)
goto out_elf_end;

Expand Down

0 comments on commit 2440419

Please sign in to comment.