This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix a snafu in a previous update to readelf that stopped it from printing archive member names along


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6a6196fc71467e39e9009d6306ef13de008c6fe3

commit 6a6196fc71467e39e9009d6306ef13de008c6fe3
Author: Nick Clifton <nickc@redhat.com>
Date:   Fri Nov 17 12:05:34 2017 +0000

    Fix a snafu in a previous update to readelf that stopped it from printing archive member names along with the archive file name.
    
    --
    This patch causes problems for glibc linknamespace tests because of how it
    changes the output format of readelf on .a files.
    
    Previously, "readelf -W -s libc.a" would produce output starting e.g.:
    
    File: /scratch/jmyers/glibc/many8/build/glibcs/x86_64-linux-gnu/glibc/libc.a(init-first.o)
    
    Symbol table '.symtab' contains 30 entries:
    
    and continuing with symbol information for each object in that .a file.
    After this commit, instead it starts:
    
    File: /scratch/jmyers/glibc/many8/build/glibcs/x86_64-linux-gnu/glibc/libc.a
    
    Symbol table '.symtab' contains 30 entries:
    
    and every object's symbol information starts with the same File: line,
    missing any information about which object's symbols (within libc.a) are
    being listed.
    
    I think the previous File: lines that said libc.a(init-first.o) etc.,
    identifying the particular object within libc.a, were clearly preferable,
    and the glibc linknamespace tests rely on having that information about
    the individual object within libc.a.
    --
    
    binutils * readelf.c (process_archive): Include member name in the
    	file_name of the filedata structure.

Diff:
---
 binutils/ChangeLog | 5 +++++
 binutils/readelf.c | 1 +
 2 files changed, 6 insertions(+)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index a469e37..16e93d7 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2017-11-17  Nick Clifton  <nickc@redhat.com>
+
+	* readelf.c (process_archive): Include member name in the
+	file_name of the filedata structure.
+
 2017-11-15  Alan Modra  <amodra@gmail.com>
 
 	PR 22426
diff --git a/binutils/readelf.c b/binutils/readelf.c
index b7f1e09..b1130a7 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -18715,6 +18715,7 @@ process_archive (Filedata * filedata, bfd_boolean is_thin_archive)
           archive_file_offset = arch.next_arhdr_offset;
           arch.next_arhdr_offset += archive_file_size;
 
+	  filedata->file_name = qualified_name;
           if (! process_object (filedata))
 	    ret = FALSE;
         }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]