This is the mail archive of the binutils@sources.redhat.com 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]

Re: PATCH: Add archive support to ELF


Hi Ian,

> I have appended an example of what the right way might look like.

Thanks Ian.  This actually looks very good, so I have applied it to
the sources.  I made one bugfix - resetting archive_file_offset and
archive_file_size before calling process_object() for a non-archive
ELF file.  This is so that if readelf is called with two or more files
on its command line and any of them are archives, their sizes will not
affect non-archive files that follow.

I also updates the dependencies in Makefile.am and added documentation
of the new feature.

Cheers
        Nick
        
binutils/ChangeLog
2003-08-11  Ian Lance Taylor <ian@airs.com>

	* readelf.c: Add ability to read archives.
	(archive_file_offset): New variable.
	(archive_file_size): New variable.
	(get_data): Include archive_file_offset in file offset
	calculation when fseeking.
	(process_program_headers): Likewise.
	(process_symbol_table): Likewise.
	(process_dynamic_segment): Handle computation of end of file
	position when the file is in an archive.
	(process_object): New function.  Contains the body of
	process_file().
	(process_archive): New function.  Call process_object on each
	member of an archive.
	(process_file): Detect archives and handle appropriately.
	* Makefile.am: Add dependency on aout/ar.h for readelf.c
	* Makefile.in: Regenerate.
	* NEWS: Document readelf's new ability.
	* doc/binutils: Alter text to say that readelf supports archives
	and 64-bit ELF files.
	


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