This is the mail archive of the mailing list for the elfutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix check for strippable relocation section.

When deciding whether a section is strippable, ebl_section_strip_p()
checks the section pointed to by the sh_info of relocation sections
to see if the relocated section is strippable.

Unfortunately a one-character typo leads to this check always being
skipped.  (You can tell it's a typo because if the condition were
correct, the next line would dereference a null pointer.)

Signed-off-by: Nick Alcock <>
 libebl/ChangeLog          | 4 ++++
 libebl/eblsectionstripp.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index af819a2..28d6b10 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,7 @@
+2012-09-18  Nick Alcock  <>
+	* eblsectionstripp.c (ebl_section_strip_p): Fix typo.
 2012-08-22  Jeff Kenton  <>
 	* eblopenbackend.c (machines): Add tilegx.
diff --git a/libebl/eblsectionstripp.c b/libebl/eblsectionstripp.c
index 9497068..6455344 100644
--- a/libebl/eblsectionstripp.c
+++ b/libebl/eblsectionstripp.c
@@ -51,7 +51,7 @@ ebl_section_strip_p (Ebl *ebl, const GElf_Ehdr *ehdr, const GElf_Shdr *shdr,
 	  Elf_Scn *scn_l = elf_getscn (ebl->elf, (shdr)->sh_info);
 	  GElf_Shdr shdr_mem_l;
 	  GElf_Shdr *shdr_l = gelf_getshdr (scn_l, &shdr_mem_l);
-	  if (shdr_l == NULL)
+	  if (shdr_l != NULL)
 	      const char *s_l = elf_strptr (ebl->elf, ehdr->e_shstrndx,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]