This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch]: Improve readelf for ia64/OpenVMS
- From: Nick Clifton <nickc at redhat dot com>
- To: Tristan Gingold <gingold at adacore dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Fri, 11 Jun 2010 09:36:11 +0100
- Subject: Re: [Patch]: Improve readelf for ia64/OpenVMS
- References: <58124D84-43E1-48F2-ABB5-3AAEBE6F6A02@adacore.com>
Hi Tristan,
This patch makes readelf dumps most of them if the object file is an IA64/OpenVMS file.
A couple of minor niggles:
- error (_("no .dynamic section in the dynamic segment\n"));
+ /* A corresponding .dynamic section is expected but on
+ IA-64/OpenVMS. */
+ if (!is_ia64_vms ())
+ error (_("no .dynamic section in the dynamic segment\n"));
I think that the comment here is incomplete. Maybe something like:
/* A corresponding .dynamic section is expected, but
on IA-64/OpenVMS it is OK for it to be missing. */
+ printf (_("\nImage fixups for needed library #%d: %s - ident: %lx\n"),
+ (int) fixup->fixup_needed,
+ fixup->needed < strtab_sz ? strtab + fixup->needed : "???",
+ (long) fixup->needed_ident);
If a value is out of range then you should let the reader know its exact
numerical amount as this might help debugging. Ie I would suggest
recoding the above as something like this:
const char * lib_name;
if (fixup->needed < strtab_sz)
lib_name = strtab + fixup->needed;
else
{
warn ("corrupt library name index of %lx found in fixup entry",
fixup->needed);
lib_name = "???";
}
printf (_("\nImage fixups for needed library #%d: %s - ident: %lx\n"),
(int) fixup->fixup_needed, lib_name,
(long) fixup->needed_ident);
Cheers
Nick