[PATCH] nm: Handle/Skip /SYM64/ index entries.
Mark Wielaard
mjw at redhat.com
Fri Dec 26 15:22:20 UTC 2014
Add a testcase to show eu-nm now handles archives with 64-bit symbol table.
Signed-off-by: Mark Wielaard <mjw at redhat.com>
---
src/ChangeLog | 4 ++++
src/nm.c | 3 ++-
tests/ChangeLog | 4 ++++
tests/run-test-archive64.sh | 14 +++++++++++++-
4 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index 18a038d..9da2853 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
2014-12-26 Mark Wielaard <mjw at redhat.com>
+ * nm.c (handle_ar): Skip over /SYM64/ entries.
+
+2014-12-26 Mark Wielaard <mjw at redhat.com>
+
* nm.c (handle_ar): Break on arsym with invalid offset.
2014-12-20 Mark Wielaard <mjw at redhat.com>
diff --git a/src/nm.c b/src/nm.c
index 6a9f8e1..be91459 100644
--- a/src/nm.c
+++ b/src/nm.c
@@ -493,7 +493,8 @@ handle_ar (int fd, Elf *elf, const char *prefix, const char *fname,
/* Skip over the index entries. */
if (strcmp (arhdr->ar_name, "/") != 0
- && strcmp (arhdr->ar_name, "//") != 0)
+ && strcmp (arhdr->ar_name, "//") != 0
+ && strcmp (arhdr->ar_name, "/SYM64/") != 0)
{
if (elf_kind (subelf) == ELF_K_ELF)
result |= handle_elf (subelf, new_prefix, arhdr->ar_name,
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 59048f6..6dd553b 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-26 Mark Wielaard <mjw at redhat.com>
+
+ * run-test-archive64.sh: Add nm test.
+
2014-12-19 Mark Wielaard <mjw at redhat.com>
* run-deleted.sh: Don't check libfunc on ppc64.
diff --git a/tests/run-test-archive64.sh b/tests/run-test-archive64.sh
index 43df16e..2d8c21d 100755
--- a/tests/run-test-archive64.sh
+++ b/tests/run-test-archive64.sh
@@ -1,5 +1,5 @@
#! /bin/sh
-# Copyright (C) 2012 Red Hat, Inc.
+# Copyright (C) 2012, 2014 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
@@ -40,4 +40,16 @@ Archive member 'ccc.o' contains:
ccc3
EOF
+testrun_compare ${abs_top_builddir}/src/nm -P -g testarchive64.a <<\EOF
+testarchive64.a[aaa.o]:
+aaa T 0000000000000000 0000000000000016
+testarchive64.a[bbb.o]:
+bbb T 0000000000000000 0000000000000016
+bbb2 T 0000000000000018 0000000000000016
+testarchive64.a[ccc.o]:
+ccc T 0000000000000000 0000000000000016
+ccc2 T 0000000000000018 0000000000000016
+ccc3 T 0000000000000030 0000000000000016
+EOF
+
exit 0
--
2.1.0
More information about the elfutils-devel
mailing list