]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
nm: Handle/Skip /SYM64/ index entries.
authorMark Wielaard <mjw@redhat.com>
Fri, 26 Dec 2014 15:20:39 +0000 (16:20 +0100)
committerMark Wielaard <mjw@redhat.com>
Mon, 12 Jan 2015 21:06:27 +0000 (22:06 +0100)
Add a testcase to show eu-nm now handles archives with 64-bit symbol table.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
src/ChangeLog
src/nm.c
tests/ChangeLog
tests/run-test-archive64.sh

index 18a038d4fe10e5673d851a52b822e408efabe286..9da28532b1a41da017f194fc62bbdb65a2e85c11 100644 (file)
@@ -1,3 +1,7 @@
+2014-12-26  Mark Wielaard  <mjw@redhat.com>
+
+       * nm.c (handle_ar): Skip over /SYM64/ entries.
+
 2014-12-26  Mark Wielaard  <mjw@redhat.com>
 
        * nm.c (handle_ar): Break on arsym with invalid offset.
index 6a9f8e1fccbcd87fec13680641a2025ac065fa98..be91459c2ec4f57e03645b8ea2fa71ca7958989a 100644 (file)
--- 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,
index 59048f65fae221d0d0e92afeaa8a6765e0d288d2..6dd553b95910980aa8922948e872feb3d7bf2df3 100644 (file)
@@ -1,3 +1,7 @@
+2014-12-26  Mark Wielaard  <mjw@redhat.com>
+
+       * run-test-archive64.sh: Add nm test.
+
 2014-12-19  Mark Wielaard  <mjw@redhat.com>
 
        * run-deleted.sh: Don't check libfunc on ppc64.
index 43df16e4490299b1446fa0ac0adb0c10702eb53f..2d8c21da925cbf35abb7e0fb390abd45e2f1f31f 100755 (executable)
@@ -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