From cdb48e066a4cd6bd487ff8f53a8f8d5bc221a1a8 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 5 Nov 2009 11:34:08 -0800 Subject: [PATCH] Ignore link_map entries with l_ld==0. --- libdwfl/ChangeLog | 4 ++++ libdwfl/link_map.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 5b876d338..48f266513 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,7 @@ +2009-11-05 Roland McGrath + + * link_map.c (report_r_debug): Skip entries with l_ld==0. + 2009-09-04 Roland McGrath * image-header.c (__libdw_image_header): Fix tranposed comparison. diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c index 2d4d75f1a..7938f85e5 100644 --- a/libdwfl/link_map.c +++ b/libdwfl/link_map.c @@ -346,6 +346,11 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t elfdata, GElf_Addr l_ld = addrs[2]; next = addrs[3]; + /* If a clobbered or truncated memory image has no useful pointer, + just skip this element. */ + if (l_ld == 0) + continue; + /* Fetch the string at the l_name address. */ const char *name = NULL; if (buffer != NULL -- 2.47.2