File elfutils-nm-Fix-nm-external-sysv-format-output.patch of Package elfutils.14006
From 62e3c37afd5828466f9192bd19217de835a3620f Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Thu, 16 Jan 2020 23:33:52 +0100
Subject: [PATCH] nm: Fix nm --external sysv format output.
Partial revert of commit 66f4c37d497bdde040a33f299b12163f044b1bf2.
If index zero wasn't a real symbol it has already been filtered out
in show_symbols so don't skip it in show_symbols_sysv.
https://sourceware.org/bugzilla/show_bug.cgi?id=25227
Reported-by: Enzo Matsumiya <ematsumiya@suse.com>
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
src/ChangeLog | 5 +++++
src/nm.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/nm.c b/src/nm.c
index 7f6cf2a2..b7c2aed6 100644
--- a/src/nm.c
+++ b/src/nm.c
@@ -787,7 +787,7 @@ show_symbols_sysv (Ebl *ebl, GElf_Word strndx, const char *fullname,
#endif
/* Iterate over all symbols. */
- for (cnt = 1; cnt < nsyms; ++cnt)
+ for (cnt = 0; cnt < nsyms; ++cnt)
{
/* In this format SECTION entries are not printed. */
if (GELF_ST_TYPE (syms[cnt].sym.st_info) == STT_SECTION)
--
2.24.1