From: Mark Wielaard Date: Fri, 26 Dec 2014 15:20:39 +0000 (+0100) Subject: nm: Handle/Skip /SYM64/ index entries. X-Git-Tag: elfutils-0.162~145 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8fb260f7137a231caf250dbe4ba64fcebd33b68d;p=thirdparty%2Felfutils.git nm: Handle/Skip /SYM64/ index entries. Add a testcase to show eu-nm now handles archives with 64-bit symbol table. Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index 18a038d4f..9da28532b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2014-12-26 Mark Wielaard + + * nm.c (handle_ar): Skip over /SYM64/ entries. + 2014-12-26 Mark Wielaard * nm.c (handle_ar): Break on arsym with invalid offset. diff --git a/src/nm.c b/src/nm.c index 6a9f8e1fc..be91459c2 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 59048f65f..6dd553b95 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2014-12-26 Mark Wielaard + + * run-test-archive64.sh: Add nm test. + 2014-12-19 Mark Wielaard * run-deleted.sh: Don't check libfunc on ppc64. diff --git a/tests/run-test-archive64.sh b/tests/run-test-archive64.sh index 43df16e44..2d8c21da9 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