Skip to content

Commit 2440419

Browse files
committedAug 20, 2021
elf_symtab: Remove needless GElf_Ehdr pointer argument from the constructor
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 <acme@redhat.com>
1 parent 74c2078 commit 2440419

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed
 

‎btf_encoder.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ struct btf_encoder *btf_encoder__new(struct cu *cu, const char *detached_filenam
13121312
goto out_delete;
13131313
}
13141314

1315-
encoder->symtab = elf_symtab__new(NULL, cu->elf, &encoder->ehdr);
1315+
encoder->symtab = elf_symtab__new(NULL, cu->elf);
13161316
if (!encoder->symtab) {
13171317
if (encoder->verbose)
13181318
printf("%s: '%s' doesn't have symtab.\n", __func__, cu->filename);

‎ctracer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ static int elf__open(const char *filename)
834834
if (init == NULL)
835835
goto out_elf_end;
836836

837-
struct elf_symtab *symtab = elf_symtab__new(".symtab", elf, &ehdr);
837+
struct elf_symtab *symtab = elf_symtab__new(".symtab", elf);
838838
if (symtab == NULL)
839839
goto out_elf_end;
840840

‎elf_symtab.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define HASHSYMS__BITS 8
1616
#define HASHSYMS__SIZE (1UL << HASHSYMS__BITS)
1717

18-
struct elf_symtab *elf_symtab__new(const char *name, Elf *elf, GElf_Ehdr *ehdr)
18+
struct elf_symtab *elf_symtab__new(const char *name, Elf *elf)
1919
{
2020
size_t symtab_index;
2121

‎elf_symtab.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct elf_symtab {
2121
char *name;
2222
};
2323

24-
struct elf_symtab *elf_symtab__new(const char *name, Elf *elf, GElf_Ehdr *ehdr);
24+
struct elf_symtab *elf_symtab__new(const char *name, Elf *elf);
2525
void elf_symtab__delete(struct elf_symtab *symtab);
2626

2727
static inline uint32_t elf_symtab__nr_symbols(const struct elf_symtab *symtab)

‎libctf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ size_t ctf__get_size(struct ctf *ctf)
282282

283283
int ctf__load_symtab(struct ctf *ctf)
284284
{
285-
ctf->symtab = elf_symtab__new(".symtab", ctf->elf, &ctf->ehdr);
285+
ctf->symtab = elf_symtab__new(".symtab", ctf->elf);
286286
return ctf->symtab == NULL ? -1 : 0;
287287
}
288288

‎pfunct.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ int elf_symtab__show(char *filename)
432432
goto out_elf_end;
433433
}
434434

435-
struct elf_symtab *symtab = elf_symtab__new(symtab_name, elf, &ehdr);
435+
struct elf_symtab *symtab = elf_symtab__new(symtab_name, elf);
436436
if (symtab == NULL)
437437
goto out_elf_end;
438438

0 commit comments

Comments
 (0)
Please sign in to comment.