Signed-off-by: Kurt Roeckx <[email protected]>
---
 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

_______________________________________________
elfutils-devel mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/elfutils-devel

Reply via email to