static bfd_vma (*byte_get) (unsigned char *, int);
static void (*byte_put) (unsigned char *, bfd_vma, int);
-typedef int Elf32_Word;
-
#define UNKNOWN -1
#define SECTION_NAME(X) ((X) == NULL ? "<none>" : \
rtype = elf_i386_reloc_type (type);
break;
- case EM_68HC11:
- case EM_68HC12:
- rtype = elf_m68hc11_reloc_type (type);
- break;
+ case EM_68HC11:
+ case EM_68HC12:
+ rtype = elf_m68hc11_reloc_type (type);
+ break;
case EM_68K:
rtype = elf_m68k_reloc_type (type);
rtype = elf_fr30_reloc_type (type);
break;
- case EM_CYGNUS_FRV:
- rtype = elf_frv_reloc_type (type);
- break;
+ case EM_CYGNUS_FRV:
+ rtype = elf_frv_reloc_type (type);
+ break;
case EM_MCORE:
rtype = elf_mcore_reloc_type (type);
{
case ET_NONE: return _("NONE (None)");
case ET_REL: return _("REL (Relocatable file)");
- case ET_EXEC: return _("EXEC (Executable file)");
- case ET_DYN: return _("DYN (Shared object file)");
- case ET_CORE: return _("CORE (Core file)");
+ case ET_EXEC: return _("EXEC (Executable file)");
+ case ET_DYN: return _("DYN (Shared object file)");
+ case ET_CORE: return _("CORE (Core file)");
default:
if ((e_type >= ET_LOPROC) && (e_type <= ET_HIPROC))
error (_("Bad sh_info in group section `%s'\n"), name);
continue;
}
-
+
group_name = SECTION_NAME (section_headers + sec_index);
strtab = NULL;
}
if (do_section_groups)
{
printf ("\n%s group section `%s' [%s] contains %u sections:\n",
- get_group_flags (entry), name, group_name, size);
-
+ get_group_flags (entry), name, group_name, size);
+
printf (_(" [Index] Name\n"));
}
sec = SECTION_HEADER (entry);
printf (" [%5u] %s\n",
entry, SECTION_NAME (sec));
- }
-
+ }
+
g = xmalloc (sizeof (struct group_list));
g->section_index = entry;
g->next = group->root;
if (!edyn)
return 0;
- dynamic_nent = dynamic_size / sizeof (*ext);
- dynamic_section = malloc (dynamic_nent * sizeof (*entry));
+/* SGI's ELF has more than one section in the DYNAMIC segment, and we
+ might not have the luxury of section headers. Look for the DT_NULL
+ terminator to determine the number of entries. */
+ for (ext = edyn, dynamic_nent = 0;
+ (char *) ext < (char *) edyn + dynamic_size;
+ ext++)
+ {
+ dynamic_nent++;
+ if (BYTE_GET (ext->d_tag) == DT_NULL)
+ break;
+ }
+ dynamic_section = malloc (dynamic_nent * sizeof (*entry));
if (dynamic_section == NULL)
{
error (_("Out of memory\n"));
}
for (ext = edyn, entry = dynamic_section;
- (char *) ext < (char *) edyn + dynamic_size;
+ entry < dynamic_section + dynamic_nent;
ext++, entry++)
{
entry->d_tag = BYTE_GET (ext->d_tag);
if (!edyn)
return 0;
- dynamic_nent = dynamic_size / sizeof (*ext);
- dynamic_section = malloc (dynamic_nent * sizeof (*entry));
+/* SGI's ELF has more than one section in the DYNAMIC segment, and we
+ might not have the luxury of section headers. Look for the DT_NULL
+ terminator to determine the number of entries. */
+ for (ext = edyn, dynamic_nent = 0;
+ (char *) ext < (char *) edyn + dynamic_size;
+ ext++)
+ {
+ dynamic_nent++;
+ if (BYTE_GET8 (ext->d_tag) == DT_NULL)
+ break;
+ }
+ dynamic_section = malloc (dynamic_nent * sizeof (*entry));
if (dynamic_section == NULL)
{
error (_("Out of memory\n"));
}
for (ext = edyn, entry = dynamic_section;
- (char *) ext < (char *) edyn + dynamic_size;
+ entry < dynamic_section + dynamic_nent;
ext++, entry++)
{
entry->d_tag = BYTE_GET8 (ext->d_tag);
case DW_TAG_partial_unit: return "DW_TAG_partial_unit";
case DW_TAG_imported_unit: return "DW_TAG_imported_unit";
/* UPC values. */
- case DW_TAG_upc_shared_type: return "DW_TAG_upc_shared_type";
- case DW_TAG_upc_strict_type: return "DW_TAG_upc_strict_type";
- case DW_TAG_upc_relaxed_type: return "DW_TAG_upc_relaxed_type";
+ case DW_TAG_upc_shared_type: return "DW_TAG_upc_shared_type";
+ case DW_TAG_upc_strict_type: return "DW_TAG_upc_strict_type";
+ case DW_TAG_upc_relaxed_type: return "DW_TAG_upc_relaxed_type";
default:
{
static char buffer[100];
data += offset_size;
}
else
- {
+ {
error (_("Internal error: DWARF version is not 2 or 3.\n"));
}
break;
initial_length_size = 12;
}
else
- {
+ {
offset_size = 4;
initial_length_size = 4;
}
unsigned long i;
printf (" Augmentation data: ");
for (i = 0; i < augmentation_data_len; ++i)
- printf (" %02x", augmentation_data[i]);
+ printf (" %02x", augmentation_data[i]);
putchar ('\n');
putchar ('\n');
}
op &= 0xc0;
/* Warning: if you add any more cases to this switch, be
- sure to add them to the corresponding switch below. */
+ sure to add them to the corresponding switch below. */
switch (op)
{
case DW_CFA_advance_loc:
}
/* Now we know what registers are used, make a second pass over
- the chunk, this time actually printing out the info. */
+ the chunk, this time actually printing out the info. */
while (start < block_end)
{