From ba2a7f4fa5f453c2b0a729bf519240a8f66a1867 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sat, 4 Aug 2018 20:36:09 +0200 Subject: backends: Always use elf_getshdrstrndx in check_special_symbol. The check_special_symbol backend functions used the Ehdr e_shstrndx field to get at the name of sections. This is not correct if there are more than SHN_LORESERVE sections. Always use elf_getshdrstrndx to get the shstrtab section. And drop the Ehdr argument that isn't necessary anymore. Signed-off-by: Mark Wielaard --- libebl/libebl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libebl/libebl.h') diff --git a/libebl/libebl.h b/libebl/libebl.h index 882bdb99..0e1f41be 100644 --- a/libebl/libebl.h +++ b/libebl/libebl.h @@ -152,7 +152,7 @@ extern bool ebl_dynamic_tag_check (Ebl *ebl, int64_t tag); /* Check whether given symbol's st_value and st_size are OK despite failing normal checks. */ -extern bool ebl_check_special_symbol (Ebl *ebl, GElf_Ehdr *ehdr, +extern bool ebl_check_special_symbol (Ebl *ebl, const GElf_Sym *sym, const char *name, const GElf_Shdr *destshdr); -- cgit v1.2.3 From 68e8b84743bdb389776e3aa2bae27aba7f435fdb Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 1 Aug 2018 16:51:03 +0200 Subject: libebl: Use elf_getshdrstrndx in ebl_section_strip_p. The ebl_section_strip_p function used the Ehdr e_shstrndx field to get at the name of the (debug) sections. This is not correct if there are more than SHN_LORESERVE sections. Use elf_getshdrstrndx to get at the shstrtab section. And drop the Ehdr argument that isn't necessary anymore. Signed-off-by: Mark Wielaard --- libebl/libebl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libebl/libebl.h') diff --git a/libebl/libebl.h b/libebl/libebl.h index 0e1f41be..5abc02d8 100644 --- a/libebl/libebl.h +++ b/libebl/libebl.h @@ -205,7 +205,7 @@ extern bool ebl_none_reloc_p (Ebl *ebl, int reloc); extern bool ebl_relative_reloc_p (Ebl *ebl, int reloc); /* Check whether section should be stripped. */ -extern bool ebl_section_strip_p (Ebl *ebl, const GElf_Ehdr *ehdr, +extern bool ebl_section_strip_p (Ebl *ebl, const GElf_Shdr *shdr, const char *name, bool remove_comment, bool only_remove_debug); -- cgit v1.2.3