Skip to content

Commit

Permalink
Remove "Unable to get section data." message
Browse files Browse the repository at this point in the history
This message may happen if library does not contain either .dynsym or
.symtab sections, which may happen and is fine. So do not issue an
error because of that.

Signed-off-by: Giuliano Belinassi <[email protected]>
  • Loading branch information
giulianobelinassi committed May 3, 2024
1 parent 5c0da8f commit 075964e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
1 change: 0 additions & 1 deletion tools/extract.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ get_list_of_symbols_in_section(Elf *elf, Elf_Scn *s)
nsyms = sh.sh_size / sh.sh_entsize;
data = elf_getdata(s, NULL);
if (!data) {
WARN("Unable to get section data.");
return NULL;
}

Expand Down
27 changes: 0 additions & 27 deletions tools/packer.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,33 +948,6 @@ parse_build_id(Elf_Scn *s, char **result, int *length)
return 0;
}

void *
get_symbol_addr(Elf *elf, Elf_Scn *s, const char *search)
{
int nsyms, i;
char *sym_name;
Elf_Data *data;
GElf_Shdr sh;
GElf_Sym sym;

gelf_getshdr(s, &sh);

nsyms = sh.sh_size / sh.sh_entsize;
data = elf_getdata(s, NULL);
if (!data) {
WARN("Unable to get section data.");
return 0;
}

for (i = 0; i < nsyms; i++) {
gelf_getsym(data, i, &sym);
sym_name = elf_strptr(elf, sh.sh_link, sym.st_name);
if (strcmp(sym_name, search) == 0)
return (void *)sym.st_value;
}
return 0;
}

int
write_patch_id(struct ulp_metadata *ulp, const char *description,
const char *livepatch)
Expand Down

0 comments on commit 075964e

Please sign in to comment.