+1998-07-19 15:15 Ulrich Drepper <drepper@cygnus.com>
+
+ * readelf.c: Fix several versioning related bugs. Produce nicer
+ output.
+
+Fri Jul 10 15:57:58 1998 Nick Clifton <nickc@cygnus.com>
+
+ * readelf.c: Switch prototypes from unsigned short to unsigned
+ int.
+
Fri Jul 10 16:17:50 1998 Ian Lance Taylor <ian@cygnus.com>
From Christian Holland <CHolland@de.lucent.com>:
Thu Jul 2 14:01:34 1998 Klaus Kaempf <kkaempf@rmi.de>
- * configure.com: Add vax/vms support.
+ * configure.com: Add vax/vms support.
* makefile.vms-in: Renamed from makefile.vms. Add substitutions
now done by configure.com.
<schwab@issan.informatik.uni-dortmund.de> including output
formatting and version info display.
- * binutils.texi: Document --section-headers switch to readelf.
+ * binutils.texi: Document --section-headers switch to readelf.
Mon Jun 22 18:28:19 1998 Ian Lance Taylor <ian@cygnus.com>
Replace calls to fprintf (stderr,...) with calls to fatal () or
non_fatal () as appropriate.
-
+
* objcopy.1: Document command line option changes.
* binutils.texi: Document command line option changes.
except that it returns rather than calling xexit().
(bfd_check_format_matches): Call fatal() rather than bfd_fatal().
-
+
(check_matching_formats): Fix C formating.
-
+
(parse_vma): Call fatal().
Mon Jun 1 18:26:40 1998 Ian Lance Taylor <ian@cygnus.com>
* dlltool.c: Add support for Thumb DLLs. Add support for
interworking between ARM and Thumb programs and DLLs. Tidy the
- code.
+ code.
* binutils.texi: Document dlltool.
Fri May 8 10:33:13 1998 Nick Clifton <nickc@cygnus.com>
* ar.c (usage): Extend information provided about command line
- options.
+ options.
Wed May 6 15:28:51 1998 Klaus Kaempf <kkaempf@progis.de>
* Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir,
INSTALL_PROGRAM, INSTALL_DATA): Use autoconf set values.
(docdir): Removed.
- * configure.in (AC_PREREQ): Autoconf 2.5 or higher.
+ * configure.in (AC_PREREQ): Autoconf 2.5 or higher.
Mon Jun 24 11:59:13 1996 Ian Lance Taylor <ian@cygnus.com>
sinfo: added a preferred alignment field.
(secdata): section data for the PowerPC version.
(make_one_lib_file): More symbols, More sections (pdata, rdata)
- (make_tail): Use idata$6 instead of idata$7 for ppc. Also added a
+ (make_tail): Use idata$6 instead of idata$7 for ppc. Also added a
NULL idata$3 descriptor (temporary).
Tue Nov 28 17:23:44 1995 Doug Evans <dje@canuck.cygnus.com>
* sysdump.c: Include "bfd.h" and "bucomm.h". Don't include
"sysdep.h" or <stdlib.h>.
(dump_symbol_info): Rename from symbol_info. Change all callers.
-
+
Mon Sep 4 14:30:00 1995 Ian Lance Taylor <ian@cygnus.com>
* configure.in (host_makefile_frag): Don't set. Substitute for
Mon Jul 24 13:52:28 1995 J.T. Conklin <jtc@rtl.cygnus.com>
* srconv.c (wr_hd): Set afl field to 4 for bfd_arch_sh.
- (writeINT): When size == -2, use 2 bytes for the h8300 and 4 bytes
+ (writeINT): When size == -2, use 2 bytes for the h8300 and 4 bytes
for the sh.
* sysdump.c (fillup): Return size - 1, the last byte is a checksum
Tue Jul 11 13:10:52 1995 J.T. Conklin <jtc@rtl.cygnus.com>
- * sysdump.c: re-indented file.
+ * sysdump.c: re-indented file.
(module): read blocks sequentially instead of trying to parse
them, as that would require changing the parser recognize the
difference between a DPSstart and DPSend block.
Mon Jul 3 14:16:47 1995 Steve Chamberlain <sac@slash.cygnus.com>
* configure.in (i386-*-win32): New configuration.
- * dlltool.c (killat, xlate, usage, long_options, main):
+ * dlltool.c (killat, xlate, usage, long_options, main):
Understand and cope with -k option.
Sat Jul 1 12:25:15 1995 Fred Fish <fnf@cygnus.com>
Fri Jul 22 10:36:50 1994 Steve Chamberlain (sac@jonny.cygnus.com)
- * coffgrok.c (doit): Zero all fields of new structure.
- * srconv.c (sysroff_swap_*_out): Remove redundant trailing arg.
+ * coffgrok.c (doit): Zero all fields of new structure.
+ * srconv.c (sysroff_swap_*_out): Remove redundant trailing arg.
* sysinfo.y: Generate sysroff_swap_*_out without requiring extra
arg.
Thu Feb 17 09:28:23 1994 David J. Mackenzie (djm@thepub.cygnus.com)
- * ar.c, bucomm.c, nlmconv.c, nm.c, objcopy.c, objdump.c,
+ * ar.c, bucomm.c, nlmconv.c, nm.c, objcopy.c, objdump.c,
size.c: Use bfd_get_error and bfd_set_error and new error names.
Fri Feb 11 15:54:51 1994 David J. Mackenzie (djm@thepub.cygnus.com)
* nlmconv.c (main): Use bfd_get_flavour instead of struct member.
* ar.c (print_contents, extract_file), size.c
- (print_berkeley_format, print_sysv_format): Use bfd_get_filename and
+ (print_berkeley_format, print_sysv_format): Use bfd_get_filename and
bfd_my_archive instead of dereferencing the structs directly.
* ar.c: Use bfd_fatal and bfd_nonfatal instead of bfd_perror and exit.
bfd_nonfatal instead of hardcoded error message if nothing matches.
* arsup.c, ar.c, objdump.c: Use bfd_get_filename instead of
- abfd->filename.
+ abfd->filename.
* nm.c (display_archive): New function, from code in display_file.
(display_rel_file): Renamed from do_one_rel_file.
* objdump.c (disassemble_data): Move some variable decls closer to
their use. Add some comments. Replace a nested block with a
- return.
+ return.
Mon Jan 31 18:50:41 1994 Stan Shebs (shebs@andros.cygnus.com)
(dump_bfd_header): New function broken out of display_bfd.
(dump_section_header): New function broken out of dump_headers.
(remove_useless_symbols): Don't shadow global variable name with
- parameter.
+ parameter.
(objdump_print_address): Fix backward test.
Tue Jan 25 19:40:54 1994 Stan Shebs (shebs@andros.cygnus.com)
(display_bfd): Pass the arg, and get it filled in by calling
bfd_check_format_matches instead of bfd_check_format.
(display_info, display_info_table): target_vector was renamed to
- bfd_target_vector.
+ bfd_target_vector.
* binutils.texi (objdump): Note some limitations of -h section
address printing.
* objdump.c (stab_name): Allocate dynamically.
(stab_print): Use pointers to strings instead of char arrays.
- (dump_stabs): Change alloc and init of arrays appropriately.
+ (dump_stabs): Change alloc and init of arrays appropriately.
(dump_stabs_1): Always decide whether to print stab_name or
the stab's type number, if unnamed.
relocs by the output_offset.
(i386_mangle_relocs): Change type of relocs argument. Cast length
argument to memmove to size_t.
- (alpha_mangle_relocs): New function.
+ (alpha_mangle_relocs): New function.
Wed Nov 17 17:38:58 1993 Sean Eric Fagan (sef@cygnus.com)
a different section. Use time_t for time variable.
(setup_sections): Only put sections with contents in output NLM.
(i386_mangle_relocs): No symbols are common at this point. Add
- casts to avoid warnings.
+ casts to avoid warnings.
Fri Sep 10 11:00:40 1993 Stan Shebs (shebs@rtl.cygnus.com)
Change output syntax to match gdb.
Thu Jun 17 16:53:56 1993 david d `zoo' zuhn (zoo@cygnus.com)
-
+
* Makefile.in: canonicalize install.sh; for use within
this directory (and subdirs)
* objdump.c (usage): Add missing options.
(display_file): Print program name before calling
- bdf_perror.
+ bdf_perror.
* nm.c (usage): Add missing options.
(main): Clean up option parser.
(display_file): Print program name before calling
- bdf_perror.
+ bdf_perror.
* copy.c (copy_usage, strip_usage): Add missing options.
* ar.c (usage): New function.
(main): Call it.
(open_inarch, do_quick_append): Print program name before calling
- bdf_perror.
+ bdf_perror.
Thu Apr 22 15:01:35 1993 Ian Lance Taylor (ian@cygnus.com)
* objdump.c: lint
* sparc-pinsn.c: include objdump.h
-
+
Fri Dec 6 23:02:14 1991 K. Richard Pixley (rich at rtl.cygnus.com)
* Makefile.in, ar.c, bucomm.c, copy.c, cplus-dem.c, filemode.c,
i960-pinsn.c, m68k-pinsn.c, nm.c, objdump.c, size.c, sparc-pinsn.c,
* strip.c: Add or update Copyright notice.
- * TODO: Add note on 'nm -a'.
+ * TODO: Add note on 'nm -a'.
* version.c: Update version number to 1.90.
* Makefile.in: Fix making of documentation for dist.
Originally developed by Eric Youngdale <eric@andante.jic.com>
Modifications by Nick Clifton <nickc@cygnus.com>
-
+
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
static void process_file PARAMS ((char * file_name));
static int process_relocs PARAMS ((FILE *));
static int process_version_sections PARAMS ((FILE *));
-static char * get_ver_flags PARAMS ((unsigned short flags));
-static char * get_symbol_index_type PARAMS ((unsigned short type));
+static char * get_ver_flags PARAMS ((unsigned int flags));
+static char * get_symbol_index_type PARAMS ((unsigned int type));
static int get_section_headers PARAMS ((FILE * file));
static int get_file_header PARAMS ((FILE * file));
static Elf_Internal_Sym * get_elf_symbols
free (var); \
var = NULL; \
return 0; \
- }
-
+ }
+
#define GET_DATA(offset, var, reason) \
if (fseek (file, offset, SEEK_SET)) \
va_end (args);
return;
}
-
+
static void
warn (const char * message, ...)
{
case 20: return "R_386_16";
case 21: return "R_386_PC16";
case 22: return "R_386_PC8";
- case 23: return "R_386_max";
+ case 23: return "R_386_max";
default: return _("*INVALID*");
}
}
Elf_Internal_Rel * rels;
Elf_Internal_Rela * relas;
-
+
/* Compute number of relocations and read them in. */
switch (elf_header.e_machine)
{
case EM_CYGNUS_D10V:
{
Elf32_External_Rel * erels;
-
+
GET_DATA_ALLOC (rel_offset, rel_size, erels,
Elf32_External_Rel *, "relocs");
-
+
rel_size = rel_size / sizeof (Elf32_External_Rel);
rels = (Elf_Internal_Rel *) malloc (rel_size *
sizeof (Elf_Internal_Rel));
-
+
for (i = 0; i < rel_size; i++)
{
rels[i].r_offset = BYTE_GET (erels[i].r_offset);
}
free (erels);
-
+
is_rela = 0;
relas = (Elf_Internal_Rela *) rels;
}
break;
-
+
case EM_68K:
case EM_SPARC:
case EM_PPC:
case EM_SH:
{
Elf32_External_Rela * erelas;
-
+
GET_DATA_ALLOC (rel_offset, rel_size, erelas,
Elf32_External_Rela *, "relocs");
-
+
rel_size = rel_size / sizeof (Elf32_External_Rela);
relas = (Elf_Internal_Rela *) malloc (rel_size *
sizeof (Elf_Internal_Rela));
-
+
for (i = 0; i < rel_size; i++)
{
relas[i].r_offset = BYTE_GET (erelas[i].r_offset);
}
free (erelas);
-
+
is_rela = 1;
rels = (Elf_Internal_Rel *) relas;
}
break;
-
+
default:
warn (_("Don't know about relocations on this machine architecture\n"));
return 0;
else
printf
(_(" Offset Value Type Symbol's Value Symbol's Name\n"));
-
+
for (i = 0; i < rel_size; i++)
{
char * rtype;
offset = rels [i].r_offset;
info = rels [i].r_info;
}
-
+
printf (" %8.8lx %5.5lx ", offset, info);
-
+
switch (elf_header.e_machine)
{
default:
rtype = "<unknown>";
break;
-
+
case EM_CYGNUS_M32R:
rtype = get_m32r_rel_type (ELF32_R_TYPE (info));
break;
-
+
case EM_386:
case EM_486:
rtype = get_i386_rel_type (ELF32_R_TYPE (info));
break;
-
+
case EM_68K:
rtype = get_m68k_rel_type (ELF32_R_TYPE (info));
break;
-
+
case EM_SPARC:
rtype = get_sparc_rel_type (ELF32_R_TYPE (info));
break;
-
+
case EM_CYGNUS_V850:
rtype = get_v850_rel_type (ELF32_R_TYPE (info));
break;
-
+
case EM_CYGNUS_D10V:
rtype = get_d10v_rel_type (ELF32_R_TYPE (info));
break;
-
+
/* start-sanitize-d30v */
case EM_CYGNUS_D30V:
rtype = get_d30v_rel_type (ELF32_R_TYPE (info));
break;
-
+
/* end-sanitize-d30v */
case EM_SH:
rtype = get_sh_rel_type (ELF32_R_TYPE (info));
break;
-
+
case EM_CYGNUS_MN10300:
rtype = get_mn10300_rel_type (ELF32_R_TYPE (info));
break;
-
+
case EM_CYGNUS_MN10200:
rtype = get_mn10200_rel_type (ELF32_R_TYPE (info));
break;
rtype = get_ppc_rel_type (ELF32_R_TYPE (info));
break;
}
-
+
printf ("%-21.21s", rtype);
-
+
symtab_index = ELF32_R_SYM (info);
-
+
if (symtab_index && symtab != NULL)
{
Elf_Internal_Sym * psym;
psym = symtab + symtab_index;
-
+
printf (" %08lx ", (unsigned long) psym->st_value);
-
+
if (psym->st_name == 0)
printf ("%-17.17s",
SECTION_NAME (section_headers + psym->st_shndx));
printf (_("<string table index %d>"), psym->st_name);
else
printf ("%-17.17s", strtab + psym->st_name);
-
+
if (is_rela)
printf (" + %lx", (unsigned long) relas [i].r_addend);
}
-
+
putchar ('\n');
}
unsigned long type;
{
static char buff [32];
-
+
switch (type)
{
case DT_NULL: return _("NULL");
case DT_VERSYM: return _("VERSYN");
case DT_AUXILIARY: return _("AUXILARY");
case DT_FILTER: return _("FILTER");
-
+
default:
if ((type >= DT_LOPROC) && (type <= DT_HIPROC))
sprintf (buff, _("Processor Specific: (%x)"), type);
unsigned e_type;
{
static char buff [32];
-
+
switch (e_type)
{
case ET_NONE: return _("None");
case ET_EXEC: return _("Executable file");
case ET_DYN: return _("Shared object file");
case ET_CORE: return _("Core file");
-
+
default:
if ((e_type >= ET_LOPROC) && (e_type <= ET_HIPROC))
sprintf (buff, _("Processor Specific: (%x)"), e_type);
unsigned e_machine;
{
static char buff [32];
-
+
switch (e_machine)
{
case EM_NONE: return _("None");
case EM_MIPS_RS4_BE: return "MIPS R400 big-endian";
case EM_OLD_SPARCV9: return "Sparc v9 (old)";
case EM_PARISC: return "HPPA";
- case EM_PPC_OLD: return "Power PC (old)";
+ case EM_PPC_OLD: return "Power PC (old)";
case EM_SPARC32PLUS: return "Sparc v8+" ;
case EM_960: return "Intel 90860";
case EM_PPC: return "PowerPC";
case EM_CYGNUS_V850: return "v850";
case EM_CYGNUS_MN10300: return "mn10300";
case EM_CYGNUS_MN10200: return "mn10200";
-
+
default:
sprintf (buff, _("<unknown>: %x"), e_machine);
return buff;
unsigned e_machine;
{
static char buf [1024];
-
+
buf[0] = '\0';
if (e_flags)
{
unsigned e_data;
{
static char buff [32];
-
+
switch (e_data)
{
case ELFDATA2LSB: return _("ELFDATA2LSB (little endian)");
unsigned long p_type;
{
static char buff [32];
-
+
switch (p_type)
{
case PT_NULL: return _("Unused");
unsigned int sh_type;
{
static char buff [32];
-
+
switch (sh_type)
{
case SHT_NULL: return _("Unused");
{"segments", no_argument, 0, 'l'},
{"sections", no_argument, 0, 'S'},
{"section-headers", no_argument, 0, 'S'},
- {"symbols", no_argument, 0, 's'},
+ {"symbols", no_argument, 0, 's'},
{"relocs", no_argument, 0, 'r'},
{"dynamic", no_argument, 0, 'd'},
{"version-info", no_argument, 0, 'V'},
#ifdef SUPPORT_DISASSEMBLY
{"instruction-dump", required_argument, 0, 'i'},
#endif
-
+
{"version", no_argument, 0, 'v'},
{"help", no_argument, 0, 'H'},
fprintf (stdout, _(" -D or --use-dynamic Use the dynamic section info when displaying symbols\n"));
fprintf (stdout, _(" -x <number> or --hex-dump=<number>\n"));
fprintf (stdout, _(" Dump the contents of section <number>\n"));
-#ifdef SUPPORT_DISASSEMBLY
+#ifdef SUPPORT_DISASSEMBLY
fprintf (stdout, _(" -i <number> or --instruction-dump=<number>\n"));
fprintf (stdout, _(" Disassemble the contents of section <number>\n"));
-#endif
+#endif
fprintf (stdout, _(" -v or --version Display the version number of readelf\n"));
fprintf (stdout, _(" -H or --help Display this information\n"));
fprintf (stdout, _("Report bugs to bug-gnu-utils@gnu.org\n"));
-
+
exit (0);
}
char ** argv;
{
int c;
-
+
if (argc < 2)
usage ();
{
char * cp;
int section;
-
+
switch (c)
{
case 'H':
usage ();
break;
-
+
case 'a':
do_syms ++;
do_reloc ++;
break;
}
goto oops;
-#ifdef SUPPORT_DISASSEMBLY
+#ifdef SUPPORT_DISASSEMBLY
case 'i':
do_dump ++;
section = strtoul (optarg, & cp, 0);
(_("Not an ELF file - it has the wrong magic bytes at the start\n"));
return 0;
}
-
+
if (elf_header.e_ident [EI_CLASS] != ELFCLASS32)
{
error (_("Not a 32 bit ELF file\n"));
return 0;
}
-
+
if (do_header)
{
int i;
-
+
printf (_("ELF Header:\n"));
printf (_(" Magic: "));
for (i = 0; i < EI_NIDENT; i ++)
printf ("%2.2x ", elf_header.e_ident [i]);
- printf ("\n");
+ printf ("\n");
printf (_(" Type: %s\n"),
get_file_type (elf_header.e_type));
printf (_(" Machine: %s\n"),
printf (_(" Section header string table index: %ld\n"),
(long) elf_header.e_shstrndx);
}
-
+
return 1;
}
Elf32_Internal_Phdr * program_headers;
Elf32_Internal_Phdr * segment;
unsigned int i;
-
+
if (elf_header.e_phnum == 0)
{
if (do_segments)
printf (_("\nThere are no program headers in this file.\n"));
return 1;
}
-
+
if (do_segments && !do_header)
{
printf (_("\nElf file is %s\n"), get_file_type (elf_header.e_type));
GET_DATA_ALLOC (elf_header.e_phoff,
elf_header.e_phentsize * elf_header.e_phnum,
phdrs, Elf32_External_Phdr *, "program headers");
-
+
program_headers = (Elf32_Internal_Phdr *) malloc
(elf_header.e_phnum * sizeof (Elf32_Internal_Phdr));
error (_("Out of memory\n"));
return 0;
}
-
+
for (i = 0, segment = program_headers;
i < elf_header.e_phnum;
i ++, segment ++)
}
free (phdrs);
-
+
if (do_segments)
{
printf
case PT_DYNAMIC:
if (dynamic_addr)
error (_("more than one dynamic segment\n"));
-
+
dynamic_addr = segment->p_offset;
dynamic_size = segment->p_filesz;
break;
{
program_interpreter[0] = 0;
fscanf (file, "%63s", program_interpreter);
-
+
if (do_segments)
printf (_("\n [Requesting program interpreter: %s]"),
program_interpreter);
}
break;
}
-
+
if (do_segments)
putc ('\n', stdout);
}
printf (_(" Segment Sections...\n"));
assert (string_table != NULL);
-
+
for (i = 0; i < elf_header.e_phnum; i++)
{
int j;
Elf32_Internal_Shdr * section;
-
+
segment = program_headers + i;
section = section_headers;
-
+
printf (" %2.2d ", i);
-
+
for (j = 0; j < elf_header.e_shnum; j++, section ++)
{
if (section->sh_size > 0
putc ('\n',stdout);
}
}
-
+
free (program_headers);
return 1;
Elf32_External_Shdr * shdrs;
Elf32_Internal_Shdr * internal;
unsigned int i;
-
+
GET_DATA_ALLOC (elf_header.e_shoff,
elf_header.e_shentsize * elf_header.e_shnum,
shdrs, Elf32_External_Shdr *, "section headers");
error (_("Out of memory\n"));
return 0;
}
-
+
for (i = 0, internal = section_headers;
i < elf_header.e_shnum;
i ++, internal ++)
Elf_Internal_Sym * isyms;
Elf_Internal_Sym * psym;
unsigned int j;
-
+
GET_DATA_ALLOC (offset, number * sizeof (Elf32_External_Sym),
esyms, Elf32_External_Sym *, "symbols");
-
+
isyms = (Elf_Internal_Sym *) malloc (number * sizeof (Elf_Internal_Sym));
-
+
if (isyms == NULL)
{
error (_("Out of memory\n"));
free (esyms);
-
+
return NULL;
}
-
+
for (j = 0, psym = isyms;
j < number;
j ++, psym ++)
int i;
section_headers = NULL;
-
+
if (elf_header.e_shnum == 0)
{
if (do_sections)
return 1;
}
-
+
if (do_sections && !do_header)
printf (_("There are %d section headers, starting at offset %x:\n"),
elf_header.e_shnum, elf_header.e_shoff);
/* Read in the string table, so that we have names to display. */
section = section_headers + elf_header.e_shstrndx;
-
+
if (section->sh_size != 0)
{
unsigned long string_table_offset;
-
+
string_table_offset = section->sh_offset;
GET_DATA_ALLOC (section->sh_offset, section->sh_size,
error (_("File contains multiple dynamic string tables\n"));
continue;
}
-
+
GET_DATA_ALLOC (section->sh_offset, section->sh_size,
dynamic_strings, char *, "dynamic strings");
}
if (! do_sections)
return 1;
-
+
printf (_("\nSection Header%s:\n"), elf_header.e_shnum > 1 ? "s" : "");
printf
(_(" [Nr] Name Type Addr Off Size ES Flg Lk Inf Al\n"));
-
+
for (i = 0, section = section_headers;
i < elf_header.e_shnum;
i ++, section ++)
i,
SECTION_NAME (section),
get_section_type_name (section->sh_type));
-
+
printf ( "%8.8lx %6.6lx %6.6lx %2.2lx",
(unsigned long) section->sh_addr,
(unsigned long) section->sh_offset,
(unsigned long) section->sh_size,
(unsigned long) section->sh_entsize);
-
+
printf (" %c%c%c %2ld %3lx %ld \n",
(section->sh_flags & SHF_WRITE ? 'W' : ' '),
(section->sh_flags & SHF_ALLOC ? 'A' : ' '),
unsigned long rel_size;
unsigned long rel_offset;
-
+
if (!do_reloc)
return 1;
-
+
if (do_using_dynamic)
{
rel_size = 0;
rel_offset = 0;
-
+
if (dynamic_info [DT_REL])
{
rel_offset = dynamic_info [DT_REL];
{
rel_offset = dynamic_info [DT_RELA];
rel_size = dynamic_info [DT_RELASZ];
- }
+ }
else if (dynamic_info [DT_JMPREL])
{
rel_offset = dynamic_info [DT_JMPREL];
printf
(_("\nRelocation section at offset 0x%x contains %d bytes:\n"),
rel_offset, rel_size);
-
+
dump_relocations (file, rel_offset - loadaddr, rel_size,
dynamic_symbols, dynamic_strings);
}
Elf32_Internal_Shdr * section;
unsigned long i;
int found = 0;
-
+
assert (string_table != NULL);
-
+
for (i = 0, section = section_headers;
i < elf_header.e_shnum;
i++, section ++)
if ( section->sh_type != SHT_RELA
&& section->sh_type != SHT_REL)
continue;
-
+
rel_offset = section->sh_offset;
rel_size = section->sh_size;
-
+
if (rel_size)
{
Elf32_Internal_Shdr * strsec;
Elf32_Internal_Shdr * symsec;
Elf_Internal_Sym * symtab;
char * strtab;
-
+
printf
(_("\nRelocation section '%s' at offset 0x%x contains %d entries:\n"),
SECTION_NAME (section), rel_offset,
symtab = get_elf_symbols (file, symsec->sh_offset,
symsec->sh_size / symsec->sh_entsize);
-
+
if (symtab == NULL)
continue;
-
+
strsec = section_headers + symsec->sh_link;
GET_DATA_ALLOC (strsec->sh_offset, strsec->sh_size, strtab,
char *, "string table");
-
+
dump_relocations (file, rel_offset, rel_size, symtab, strtab);
free (strtab);
found = 1;
}
}
-
+
if (! found)
printf (_("\nThere are no relocations in this file.\n"));
}
Elf_Internal_Dyn * entry;
Elf32_External_Dyn * edyn;
unsigned int i;
-
+
if (dynamic_size == 0)
{
if (do_dynamic)
GET_DATA_ALLOC (dynamic_addr, dynamic_size,
edyn, Elf32_External_Dyn *, "dynamic segment");
-
+
dynamic_size = dynamic_size / sizeof (Elf32_External_Dyn);
dynamic_segment = (Elf_Internal_Dyn *)
free (edyn);
return 0;
}
-
+
for (i = 0, entry = dynamic_segment;
i < dynamic_size;
i ++, entry ++)
}
free (edyn);
-
+
/* Find the appropriate symbol table. */
if (dynamic_symbols == NULL)
{
{
unsigned long offset;
long num_syms;
-
+
if (entry->d_tag != DT_SYMTAB)
continue;
we default to reading in the entire file (!) and
processing that. This is overkill, I know, but it
should work. */
-
+
offset = entry->d_un.d_val - loadaddr;
-
+
if (fseek (file, 0, SEEK_END))
error (_("Unable to seek to end of file!"));
-
+
num_syms = (ftell (file) - offset) / sizeof (Elf32_External_Sym);
if (num_syms < 1)
{
unsigned long offset;
long str_tab_len;
-
+
if (entry->d_tag != DT_STRTAB)
continue;
dynamic_info [DT_STRTAB] = entry->d_un.d_val;
-
+
/* Since we do not know how big the string table is,
we default to reading in the entire file (!) and
processing that. This is overkill, I know, but it
should work. */
-
+
offset = entry->d_un.d_val - loadaddr;
if (fseek (file, 0, SEEK_END))
error (_("Unable to seek to end of file\n"));
break;
}
}
-
+
if (do_dynamic && dynamic_addr)
- printf (_("\nDynamic segement at offset 0x%x contains %d entries:\n"),
+ printf (_("\nDynamic segment at offset 0x%x contains %d entries:\n"),
dynamic_addr, dynamic_size);
if (do_dynamic)
- printf (_(" Tag Type Name/Value\n"));
-
+ printf (_(" Tag Type Name/Value\n"));
+
for (i = 0, entry = dynamic_segment;
i < dynamic_size;
i++, entry ++)
{
if (do_dynamic)
- printf (_(" 0x%-6.6lx (%-11.11s) "),
+ printf (_(" 0x%-8.8lx (%s)%*s"),
(unsigned long) entry->d_tag,
- get_dynamic_type (entry->d_tag));
-
+ get_dynamic_type (entry->d_tag),
+ 12 - strlen (get_dynamic_type (entry->d_tag)),
+ " ");
+
switch (entry->d_tag)
{
case DT_AUXILIARY:
printf (_("Filter library"));
if (dynamic_strings)
- printf (": [%s]\n", dynamic_strings + entry->d_un.d_val);
+ printf (": [%s]\n", dynamic_strings + entry->d_un.d_val);
else
printf (": %#lx\n", (long) entry->d_un.d_val);
}
break;
-
+
case DT_NULL :
case DT_NEEDED :
case DT_PLTRELSZ:
case DT_TEXTREL :
case DT_JMPREL :
dynamic_info [entry->d_tag] = entry->d_un.d_val;
-
+
if (do_dynamic)
{
char * name;
name = NULL;
else
name = dynamic_strings + entry->d_un.d_val;
-
+
if (name)
{
switch (entry->d_tag)
{
case DT_NEEDED:
printf (_("Shared library: [%s]"), name);
-
+
if (strcmp (name, program_interpreter))
printf ("\n");
else
break;
}
}
-
+
free (dynamic_segment);
return 1;
static char *
get_ver_flags (flags)
- unsigned short flags;
+ unsigned int flags;
{
static char buff [32];
if (flags == 0)
return _("none");
-
+
if (flags & VER_FLG_BASE)
strcat (buff, "BASE ");
{
if (flags & VER_FLG_BASE)
strcat (buff, "| ");
-
+
strcat (buff, "WEAK ");
}
Elf32_Internal_Shdr * section;
unsigned i;
int found = 0;
-
+
if (! do_version)
return 1;
-
+
for (i = 0, section = section_headers;
i < elf_header.e_shnum;
i++, section ++)
Elf_External_Verdef * edefs;
unsigned int idx;
unsigned int cnt;
-
+
found = 1;
-
+
printf
(_("\nVersion definition section '%s' contains %d entries:\n"),
SECTION_NAME (section), section->sh_info);
-
+
printf (_(" Addr: %#08x Offset: %#08x Link: %x (%s)\n"),
section->sh_addr, section->sh_offset, section->sh_link,
SECTION_NAME (section_headers + section->sh_link));
GET_DATA_ALLOC (section->sh_offset, section->sh_size,
edefs, Elf_External_Verdef *,
"version definition section");
-
+
for (idx = cnt = 0; cnt < section->sh_info; ++ cnt)
{
char * vstart;
int isum;
vstart = ((char *) edefs) + idx;
-
+
edef = (Elf_External_Verdef *) vstart;
ent.vd_version = BYTE_GET (edef->vd_version);
ent.vd_hash = BYTE_GET (edef->vd_hash);
ent.vd_aux = BYTE_GET (edef->vd_aux);
ent.vd_next = BYTE_GET (edef->vd_next);
-
+
printf (_(" %#06x: Rev: %d Flags: %s"),
idx, ent.vd_version, get_ver_flags (ent.vd_flags));
-
+
printf (_(" Index: %ld Cnt: %ld "), ent.vd_ndx, ent.vd_cnt);
vstart += ent.vd_aux;
-
+
eaux = (Elf_External_Verdaux *) vstart;
-
+
aux.vda_name = BYTE_GET (eaux->vda_name);
aux.vda_next = BYTE_GET (eaux->vda_next);
-
+
if (dynamic_strings)
printf (_("Name: %s\n"), dynamic_strings + aux.vda_name);
else
printf (_("Name index: %ld\n"), aux.vda_name);
-
+
isum = idx + ent.vd_aux;
-
+
for (j = 1; j < ent.vd_cnt; j ++)
{
isum += aux.vda_next;
vstart += aux.vda_next;
-
+
eaux = (Elf_External_Verdaux *) vstart;
-
+
aux.vda_name = BYTE_GET (eaux->vda_name);
aux.vda_next = BYTE_GET (eaux->vda_next);
-
+
if (dynamic_strings)
printf (_(" %#06x: Parent %d: %s\n"),
isum, j, dynamic_strings + aux.vda_name);
idx += ent.vd_next;
}
-
+
free (edefs);
}
break;
-
+
case SHT_GNU_verneed:
{
Elf_External_Verneed * eneed;
unsigned int idx;
unsigned int cnt;
-
+
found = 1;
-
+
printf (_("\nVersion needs section '%s' contains %d entries:\n"),
SECTION_NAME (section), section->sh_info);
-
+
printf
(_(" Addr: %#08x Offset: %#08x Link to section: %d (%s)\n"),
section->sh_addr, section->sh_offset, section->sh_link,
GET_DATA_ALLOC (section->sh_offset, section->sh_size,
eneed, Elf_External_Verneed *,
"version need section");
-
+
for (idx = cnt = 0; cnt < section->sh_info; ++cnt)
{
Elf_External_Verneed * entry;
int j;
int isum;
char * vstart;
-
+
vstart = ((char *) eneed) + idx;
-
+
entry = (Elf_External_Verneed *) vstart;
-
+
ent.vn_version = BYTE_GET (entry->vn_version);
ent.vn_cnt = BYTE_GET (entry->vn_cnt);
ent.vn_file = BYTE_GET (entry->vn_file);
ent.vn_aux = BYTE_GET (entry->vn_aux);
ent.vn_next = BYTE_GET (entry->vn_next);
-
+
printf (_(" %#06x: Version: %d"), idx, ent.vn_version);
if (dynamic_strings)
printf (_(" File: %s"), dynamic_strings + ent.vn_file);
else
printf (_(" File: %lx"), ent.vn_file);
-
+
printf (_(" Cnt: %d\n"), ent.vn_cnt);
vstart += ent.vn_aux;
-
+
for (j = 0, isum = idx + ent.vn_aux; j < ent.vn_cnt; ++j)
{
Elf_External_Vernaux * eaux;
Elf_Internal_Vernaux aux;
-
+
eaux = (Elf_External_Vernaux *) vstart;
-
+
aux.vna_hash = BYTE_GET (eaux->vna_hash);
aux.vna_flags = BYTE_GET (eaux->vna_flags);
aux.vna_other = BYTE_GET (eaux->vna_other);
else
printf (_(" %#06x: Name index: %lx"),
isum, aux.vna_name);
-
+
printf (_(" Flags: %s Version: %d\n"),
get_ver_flags (aux.vna_flags), aux.vna_other);
-
+
isum += aux.vna_next;
vstart += aux.vna_next;
}
-
+
idx += ent.vn_next;
}
free (eneed);
}
break;
-
+
case SHT_GNU_versym:
{
Elf32_Internal_Shdr * link_section;
link_section = section_headers + section->sh_link;
total = section->sh_size / section->sh_entsize;
-
+
found = 1;
symbols = get_elf_symbols
(file, link_section->sh_offset,
link_section->sh_size / link_section->sh_entsize);
-
+
string_sec = section_headers + link_section->sh_link;
GET_DATA_ALLOC (string_sec->sh_offset, string_sec->sh_size,
strtab, char *, "version string table");
-
+
printf (_("\nVersion symbols section '%s' contains %d entries:\n"),
SECTION_NAME (section), total);
-
+
printf (_(" Addr: %#08x Offset: %#08x Link: %x (%s)\n"),
section->sh_addr, section->sh_offset, section->sh_link,
SECTION_NAME (link_section));
char *, "version symbol data");
data = (unsigned short *) malloc (total * sizeof (short));
-
+
for (cnt = total; cnt --;)
data [cnt] = byte_get (edata + cnt * sizeof (short), sizeof (short));
free (edata);
-
+
for (cnt = 0; cnt < total; cnt += 4)
{
int j, nn;
-
+
printf (" %03x:", cnt);
-
+
for (j = 0; (j < 4) && (cnt + j) < total; ++j)
switch (data [cnt + j])
{
case 0:
- printf (" 0 (*local*) ");
+ fputs (_(" 0 (*local*) "), stdout);
break;
-
+
case 1:
- printf (" 1 (*global*) ");
+ fputs (_(" 1 (*global*) "), stdout);
break;
-
+
default:
nn = printf ("%4x%c", data [cnt + j] & 0x7fff,
data [cnt + j] & 0x8000 ? 'h' : ' ');
offset = version_info [DT_VERSIONTAGIDX (DT_VERNEED)]
- loadaddr;
-
+
do
{
Elf_External_Verneed evn;
ivn.vn_aux = BYTE_GET (evn.vn_aux);
ivn.vn_next = BYTE_GET (evn.vn_next);
-
+
vna_off = offset + ivn.vn_aux;
do
ivna.vna_next = BYTE_GET (evna.vna_next);
ivna.vna_other = BYTE_GET (evna.vna_other);
-
+
vna_off += ivna.vna_next;
}
while (ivna.vna_other != data [cnt + j]
&& ivna.vna_next != 0);
-
+
if (ivna.vna_other == data [cnt + j])
{
ivna.vna_name = BYTE_GET (evna.vna_name);
-
- nn += printf ("(%11.11s)",
- strtab + ivna.vna_name);
+
+ nn += printf ("(%s%-*s",
+ strtab + ivna.vna_name,
+ 12 - strlen (strtab
+ + ivna.vna_name),
+ ")");
break;
}
else if (ivn.vn_next == 0)
offset = version_info
[DT_VERSIONTAGIDX (DT_VERDEF)]
- loadaddr;
-
+
do
{
GET_DATA (offset, evd,
ivd.vd_next = BYTE_GET (evd.vd_next);
ivd.vd_ndx = BYTE_GET (evd.vd_ndx);
-
+
offset += ivd.vd_next;
}
while (ivd.vd_ndx
{
Elf_External_Verdaux evda;
Elf_Internal_Verdaux ivda;
-
+
ivd.vd_aux = BYTE_GET (evd.vd_aux);
GET_DATA (offset + ivd.vd_aux, evda,
"version definition aux");
-
+
ivda.vda_name =
BYTE_GET (evda.vda_name);
-
+
nn +=
- printf ("(%11.11s)",
- strtab + ivda.vda_name);
+ printf ("(%s%-*s",
+ strtab + ivda.vda_name,
+ 12
+ - strlen (strtab
+ + ivda.vda_name),
+ ")");
}
}
-
+
break;
}
else
{
Elf_Internal_Verneed ivn;
unsigned long offset;
-
+
offset = version_info [DT_VERSIONTAGIDX (DT_VERNEED)]
- loadaddr;
ivn.vn_aux = BYTE_GET (evn.vn_aux);
ivn.vn_next = BYTE_GET (evn.vn_next);
-
+
a_off = offset + ivn.vn_aux;
-
+
do
{
GET_DATA (a_off, evna,
ivna.vna_next = BYTE_GET (evna.vna_next);
ivna.vna_other = BYTE_GET (evna.vna_other);
-
+
a_off += ivna.vna_next;
}
while (ivna.vna_other != data [cnt + j]
&& ivna.vna_next != 0);
-
+
if (ivna.vna_other == data [cnt + j])
{
ivna.vna_name = BYTE_GET (evna.vna_name);
-
- nn += printf ("(%11.11s)",
- strtab + ivna.vna_name);
+
+ nn += printf ("(%s%-*s",
+ strtab + ivna.vna_name,
+ 12 - strlen (strtab
+ + ivna.vna_name),
+ ")");
break;
}
Elf_Internal_Verdef ivd;
Elf_External_Verdef evd;
unsigned long offset;
-
+
offset = version_info
[DT_VERSIONTAGIDX (DT_VERDEF)] - loadaddr;
-
+
do
{
GET_DATA (offset, evd, "version def");
ivd.vd_next = BYTE_GET (evd.vd_next);
ivd.vd_ndx = BYTE_GET (evd.vd_ndx);
-
+
offset += ivd.vd_next;
}
while (ivd.vd_ndx != (data [cnt + j] & 0x7fff)
&& ivd.vd_next != 0);
-
+
if (ivd.vd_ndx == (data [cnt + j] & 0x7fff))
{
Elf_External_Verdaux evda;
Elf_Internal_Verdaux ivda;
-
+
ivd.vd_aux = BYTE_GET (evd.vd_aux);
-
+
GET_DATA (offset - ivd.vd_next + ivd.vd_aux,
evda, "version def aux");
-
+
ivda.vda_name = BYTE_GET (evda.vda_name);
-
- nn += printf ("(%11.11s)",
- strtab + ivda.vda_name);
+
+ nn += printf ("(%s%-*s",
+ strtab + ivda.vda_name,
+ 12 - strlen (strtab
+ + ivda.vda_name),
+ ")");
}
}
-
+
if (nn < 18)
printf ("%*c", 18 - nn, ' ');
}
-
+
putchar ('\n');
}
free (symbols);
}
break;
-
+
default:
break;
}
}
-
+
if (! found)
printf (_("\nNo version information found in this file.\n"));
unsigned int binding;
{
static char buff [32];
-
+
switch (binding)
{
case STB_LOCAL: return _("LOCAL");
unsigned int type;
{
static char buff [32];
-
+
switch (type)
{
case STT_NOTYPE: return _("NOTYPE");
static char *
get_symbol_index_type (type)
- unsigned short type;
+ unsigned int type;
{
switch (type)
{
else
{
static char buff [32];
-
+
sprintf (buff, "%3d", type);
return buff;
}
{
char * e_data;
int * i_data;
-
+
e_data = (char *) malloc (number * 4);
-
+
if (e_data == NULL)
{
error (_("Out of memory\n"));
return NULL;
}
-
+
if (fread (e_data, 4, number, file) != number)
{
error (_("Unable to read in dynamic data\n"));
return NULL;
}
-
+
i_data = (int *) malloc (number * sizeof (* i_data));
if (i_data == NULL)
free (e_data);
return NULL;
}
-
+
while (number--)
i_data [number] = byte_get (e_data + number * 4, 4);
-
+
free (e_data);
return i_data;
FILE * file;
{
Elf32_Internal_Shdr * section;
-
+
if (! do_syms)
return 1;
-
+
if (dynamic_info [DT_HASH] && do_using_dynamic && dynamic_strings != NULL)
{
char nb [4];
error (_("Failed to read in number of buckets\n"));
return 0;
}
-
+
if (fread (& nc, sizeof (nc), 1, file) != 1)
{
error (_("Failed to read in number of chains\n"));
nbuckets = byte_get (nb, 4);
nchains = byte_get (nc, 4);
-
+
buckets = get_dynamic_data (file, nbuckets);
chains = get_dynamic_data (file, nchains);
if (buckets == NULL || chains == NULL)
return 0;
-
+
printf (_("\nSymbol table for image:\n"));
printf (_(" Num Buc: Value Size Type Bind Ot Ndx Name\n"));
-
+
for (hn = 0; hn < nbuckets; hn++)
{
if (! buckets [hn])
continue;
-
+
for (si = buckets [hn]; si; si = chains [si])
{
Elf_Internal_Sym * psym;
psym = dynamic_symbols + si;
-
+
printf (" %3d %3d: %8lx %5ld %6s %6s %2d ",
si, hn,
(unsigned long) psym->st_value,
psym->st_other);
printf ("%3.3s", get_symbol_index_type (psym->st_shndx));
-
+
printf (" %s\n", dynamic_strings + psym->st_name);
}
}
else if (!do_using_dynamic)
{
unsigned int i;
-
+
for (i = 0, section = section_headers;
i < elf_header.e_shnum;
i++, section++)
Elf_Internal_Sym * symtab;
Elf_Internal_Sym * psym;
-
+
if ( section->sh_type != SHT_SYMTAB
&& section->sh_type != SHT_DYNSYM)
continue;
-
+
printf (_("\nSymbol table '%s' contains %d entries:\n"),
SECTION_NAME (section),
section->sh_size / section->sh_entsize);
- printf (_(" Num: Value Size Type Bind Ot Ndx Name\n"));
+ fputs (_(" Num: Value Size Type Bind Ot Ndx Name\n"),
+ stdout);
symtab = get_elf_symbols (file, section->sh_offset,
section->sh_size / section->sh_entsize);
if (symtab == NULL)
continue;
-
+
if (section->sh_link == elf_header.e_shstrndx)
strtab = string_table;
else
{
Elf32_Internal_Shdr * string_sec;
-
+
string_sec = section_headers + section->sh_link;
-
+
GET_DATA_ALLOC (string_sec->sh_offset, string_sec->sh_size,
strtab, char *, "string table");
}
-
+
for (si = 0, psym = symtab;
si < section->sh_size / section->sh_entsize;
si ++, psym ++)
get_symbol_type (ELF_ST_TYPE (psym->st_info)),
get_symbol_binding (ELF_ST_BIND (psym->st_info)),
psym->st_other);
-
+
if (psym->st_shndx == 0)
- printf ("UND");
+ fputs ("UND", stdout);
else if ((psym->st_shndx & 0xffff) == 0xfff1)
- printf ("ABS");
+ fputs ("ABS", stdout);
else if ((psym->st_shndx & 0xffff) == 0xfff2)
- printf ("COM");
+ fputs ("COM", stdout);
else
printf ("%3d", psym->st_shndx);
-
+
printf (" %s", strtab + psym->st_name);
-
+
if (section->sh_type == SHT_DYNSYM &&
version_info [DT_VERSIONTAGIDX (DT_VERSYM)] != 0)
{
unsigned long offset;
int is_nobits;
int check_def;
-
+
offset = version_info [DT_VERSIONTAGIDX (DT_VERSYM)]
- loadaddr;
is_nobits = psym->st_shndx < SHN_LORESERVE ?
(section_headers [psym->st_shndx].sh_type == SHT_NOBITS)
: 0;
-
+
check_def = (psym->st_shndx != SHN_UNDEF);
-
+
if ((vers_data & 0x8000) || vers_data > 1)
{
if (is_nobits || ! check_def)
Elf_External_Verneed evn;
Elf_Internal_Verneed ivn;
Elf_Internal_Vernaux ivna;
-
+
/* We must test both. */
offset = version_info
[DT_VERSIONTAGIDX (DT_VERNEED)] - loadaddr;
ivn.vn_aux = BYTE_GET (evn.vn_aux);
ivn.vn_next = BYTE_GET (evn.vn_next);
-
+
do
{
unsigned long vna_off;
-
+
vna_off = offset + ivn.vn_aux;
do
{
Elf_External_Vernaux evna;
-
+
GET_DATA (vna_off, evna,
"version need aux (3)");
ivna.vna_other = BYTE_GET (evna.vna_other);
ivna.vna_next = BYTE_GET (evna.vna_next);
+ ivna.vna_name = BYTE_GET (evna.vna_name);
vna_off += ivna.vna_next;
}
while (ivna.vna_other != vers_data
&& ivna.vna_next != 0);
-
+
if (ivna.vna_other == vers_data)
break;
-
+
offset += ivn.vn_next;
}
while (ivn.vn_next != 0);
-
+
if (ivna.vna_other == vers_data)
- printf ("@%s (%d)",
- strtab + ivna.vna_name, ivna.vna_other);
+ {
+ printf ("@%s (%d)",
+ strtab + ivna.vna_name, ivna.vna_other);
+ check_def = 0;
+ }
else if (! is_nobits)
error (_("bad dynamic symbol"));
else
check_def = 1;
}
-
+
if (check_def)
{
if (vers_data != 0x8001)
do
{
Elf_External_Verdef evd;
-
+
GET_DATA (offset, evd, "version def");
ivd.vd_ndx = BYTE_GET (evd.vd_ndx);
ivd.vd_aux = BYTE_GET (evd.vd_aux);
ivd.vd_next = BYTE_GET (evd.vd_next);
-
+
offset += ivd.vd_next;
}
while (ivd.vd_ndx != (vers_data & 0x7fff)
offset += ivd.vd_aux;
GET_DATA (offset, evda, "version def aux");
-
+
ivda.vda_name = BYTE_GET (evda.vda_name);
-
+
if (psym->st_name != ivda.vda_name)
printf ((vers_data & 0x8000)
? "@%s" : "@@%s",
}
}
}
-
+
putchar ('\n');
}
{
#ifdef SUPPORT_DISASSEMBLY
/* See if we need an assembly dump of this section */
-
+
if ((i < NUM_DUMP_SECTS) && (dump_sects[i] & DISASS_DUMP))
{
printf (_("\nAssembly dump of section %s\n"),
SECTION_NAME (section));
-
+
/* XXX -- to be done --- XXX */
}
#endif
int addr;
unsigned char * data;
char * start;
-
+
printf (_("\nHex dump of section '%s':\n"), SECTION_NAME (section));
-
+
bytes = section->sh_size;
addr = section->sh_addr;
"section data");
data = start;
-
+
while (bytes)
{
int j;
int k;
int lbytes;
-
+
lbytes = (bytes > 16 ? 16 : bytes);
-
+
printf (" 0x%8.8x ", addr);
-
+
switch (elf_header.e_ident [EI_DATA])
{
case ELFDATA2LSB:
printf ("%2.2x", data [j]);
else
printf (" ");
-
+
if (!(j & 0x3))
printf (" ");
}
break;
-
+
case ELFDATA2MSB:
for (j = 0; j < 16; j++)
{
printf ("%2.2x", data [j]);
else
printf (" ");
-
+
if ((j & 3) == 3)
printf (" ");
}
break;
}
-
+
for (j = 0; j < lbytes; j++)
{
k = data [j];
else
printf (".");
}
-
+
putchar ('\n');
-
+
data += lbytes;
addr += lbytes;
bytes -= lbytes;
FILE * file;
struct stat statbuf;
unsigned int i;
-
+
if (stat (file_name, & statbuf) < 0)
{
error (_("Cannot stat input file %s.\n"), file_name);
fclose (file);
return;
}
-
+
/* Initialise per file variables. */
for (i = NUM_ELEM (version_info); i--;)
version_info [i] = 0;
-
+
for (i = NUM_ELEM (dynamic_info); i--;)
dynamic_info [i] = 0;
-
+
/* Process the file. */
if (show_name)
printf (_("\nFile: %s\n"), file_name);
-
+
if (! process_file_header ())
{
fclose (file);
process_section_headers (file);
process_program_headers (file);
-
+
process_dynamic_segment (file);
process_relocs (file);
-
+
process_symbol_table (file);
process_version_sections (file);
process_section_contents (file);
-
+
fclose (file);
-
+
if (section_headers)
{
free (section_headers);
if (optind < (argc - 1))
show_name = 1;
-
+
while (optind < argc)
process_file (argv [optind ++]);