This is the mail archive of the elfutils-devel@sourceware.org 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 2/4] print_debug: Use ebl_debugscn_p() to check if it's a debug section.


Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
---
 src/readelf.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/readelf.c b/src/readelf.c
index 36724a7..cba5717 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -7786,8 +7786,9 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
     {
       GElf_Shdr shdr_mem;
       GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+      const char *name = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
 
-      if (shdr != NULL && shdr->sh_type == SHT_PROGBITS)
+      if (ebl_debugscn_p(ebl, name) && shdr != NULL && shdr->sh_type == SHT_PROGBITS)
 	{
 	  static const struct
 	  {
@@ -7821,8 +7822,6 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
 	    };
 	  const int ndebug_sections = (sizeof (debug_sections)
 				       / sizeof (debug_sections[0]));
-	  const char *name = elf_strptr (ebl->elf, shstrndx,
-					 shdr->sh_name);
 	  int n;
 
 	  for (n = 0; n < ndebug_sections; ++n)
-- 
1.7.10.4


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