/* This is a special case, generated by the BYTE_GET8 macro.
It means that we are loading an 8 byte value from a field
in an external structure into an 8 byte value in a field
- in an internal strcuture. */
+ in an internal structure. */
return ((bfd_vma) (field[0]))
| (((bfd_vma) (field[1])) << 8)
| (((bfd_vma) (field[2])) << 16)
/* This is a special case, generated by the BYTE_GET8 macro.
It means that we are loading an 8 byte value from a field
in an external structure into an 8 byte value in a field
- in an internal strcuture. */
+ in an internal structure. */
return ((bfd_vma) (field[7]))
| (((bfd_vma) (field[6])) << 8)
| (((bfd_vma) (field[5])) << 16)
sec_name = "ABS";
else if (psym->st_shndx == SHN_COMMON)
sec_name = "COMMON";
+ else if (elf_header.e_machine == EM_IA_64
+ && elf_header.e_ident[EI_OSABI] == ELFOSABI_HPUX
+ && psym->st_shndx == SHN_IA_64_ANSI_COMMON)
+ sec_name = "ANSI_COM";
else
{
sprintf (name_buf, "<section 0x%x>",
case EM_CYGNUS_V850:
switch (e_flags & EF_V850_ARCH)
{
+ case E_V850E1_ARCH:
+ strcat (buf, ", v850e1");
+ break;
case E_V850E_ARCH:
strcat (buf, ", v850e");
break;
case E_MIPS_ARCH_32: strcat (buf, ", mips32"); break;
case E_MIPS_ARCH_32R2: strcat (buf, ", mips32r2"); break;
case E_MIPS_ARCH_64: strcat (buf, ", mips64"); break;
+ case E_MIPS_ARCH_64R2: strcat (buf, ", mips64r2"); break;
default: strcat (buf, ", unknown ISA"); break;
}
aux.vna_next = BYTE_GET (eaux->vna_next);
if (dynamic_strings)
- printf (_(" %#06x: Name: %s"),
+ printf (_(" %#06x: Name: %s"),
isum, dynamic_strings + aux.vna_name);
else
- printf (_(" %#06x: Name index: %lx"),
+ printf (_(" %#06x: Name index: %lx"),
isum, aux.vna_name);
printf (_(" Flags: %s Version: %d\n"),
case SHN_ABS: return "ABS";
case SHN_COMMON: return "COM";
default:
- if (type >= SHN_LOPROC && type <= SHN_HIPROC)
+ if (type == SHN_IA_64_ANSI_COMMON
+ && elf_header.e_machine == EM_IA_64
+ && elf_header.e_ident[EI_OSABI] == ELFOSABI_HPUX)
+ return "ANSI_COM";
+ else if (type >= SHN_LOPROC && type <= SHN_HIPROC)
sprintf (buff, "PRC[0x%04x]", type);
else if (type >= SHN_LOOS && type <= SHN_HIOS)
sprintf (buff, "OS [0x%04x]", type);
bytes = section->sh_size;
- if (bytes == 0)
+ if (bytes == 0 || section->sh_type == SHT_NOBITS)
{
printf (_("\nSection '%s' has no data to dump.\n"),
SECTION_NAME (section));
for (j = 0; j < lbytes; j++)
{
k = data[j];
- if (k >= ' ' && k < 0x80)
+ if (k >= ' ' && k < 0x7f)
printf ("%c", k);
else
printf (".");
}
}
-/* FIXME: There are better and more effiecint ways to handle
+/* FIXME: There are better and more efficient ways to handle
these structures. For now though, I just want something that
is simple to implement. */
typedef struct abbrev_attr
/* Normally, the lists in the debug_loc section are related to a
given compilation unit, and thus, we would use the pointer size
of that compilation unit. However, since we are displaying it
- seperately here, we either have to store pointer sizes of all
+ separately here, we either have to store pointer sizes of all
compilation units, or assume they don't change. We assume,
like the debug_line display, that it doesn't change. */
begin = byte_get (start, debug_line_pointer_size);
break;
}
- /* For some attributes we can display futher information. */
+ /* For some attributes we can display further information. */
printf ("\t");
/* If we have been compiled with sizeof (bfd_vma) == 4, then
we will not be able to cope with the 64bit data found in
64 ELF files. Detect this now and abort before we start
- overwritting things. */
+ overwriting things. */
if (sizeof (bfd_vma) < 8)
{
error (_("This instance of readelf has been built without support for a\n\
char *longnames = NULL;
unsigned long longnames_size = 0;
size_t file_name_size;
+ int ret;
show_name = 1;
if (fread (longnames, longnames_size, 1, file) != 1)
{
+ free (longnames);
error(_("%s: failed to read string table\n"), file_name);
return 1;
}
got = fread (&arhdr, 1, sizeof arhdr, file);
if (got != sizeof arhdr)
{
+ free (longnames);
+
if (got == 0)
return 0;
}
file_name_size = strlen (file_name);
+ ret = 0;
while (1)
{
if (off >= longnames_size)
{
error (_("%s: invalid archive string table offset %lu\n"), off);
- return 1;
+ ret = 1;
+ break;
}
name = longnames + off;
if (nameend == NULL)
{
error (_("%s: bad archive file name\n"));
- return 1;
+ ret = 1;
+ break;
}
namealc = malloc (file_name_size + (nameend - name) + 3);
if (namealc == NULL)
{
error (_("Out of memory\n"));
- return 1;
+ ret = 1;
+ break;
}
memcpy (namealc, file_name, file_name_size);
archive_file_offset = ftell (file);
archive_file_size = strtoul (arhdr.ar_size, NULL, 10);
- process_object (namealc, file);
+ ret |= process_object (namealc, file);
free (namealc);
SEEK_SET) != 0)
{
error (_("%s: failed to seek to next archive header\n"), file_name);
- return 1;
+ ret = 1;
+ break;
}
got = fread (&arhdr, 1, sizeof arhdr, file);
if (got != sizeof arhdr)
{
if (got == 0)
- return 0;
+ break;
error (_("%s: failed to read archive header\n"), file_name);
- return 1;
+ ret = 1;
+ break;
}
}
if (longnames != 0)
free (longnames);
- return 0;
+ return ret;
}
static int