projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* readelf.c (process_section_headers): Add m16c handler.
[deliverable/binutils-gdb.git]
/
binutils
/
readelf.c
diff --git
a/binutils/readelf.c
b/binutils/readelf.c
index b64f77538775df517df9491e190b4dd8a9ab5dba..20a7681f411841a0a29ebfc1829af5e3856995b2 100644
(file)
--- a/
binutils/readelf.c
+++ b/
binutils/readelf.c
@@
-1,6
+1,6
@@
/* readelf.c -- display contents of an ELF format file
/* readelf.c -- display contents of an ELF format file
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
- Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
,
+
2008
Free Software Foundation, Inc.
Originally developed by Eric Youngdale <eric@andante.jic.com>
Modifications by Nick Clifton <nickc@redhat.com>
Originally developed by Eric Youngdale <eric@andante.jic.com>
Modifications by Nick Clifton <nickc@redhat.com>
@@
-493,7
+493,11
@@
print_vma (bfd_vma vma, print_mode mode)
#if BFD_HOST_64BIT_LONG
return nc + printf ("%lx", vma);
#elif BFD_HOST_64BIT_LONG_LONG
#if BFD_HOST_64BIT_LONG
return nc + printf ("%lx", vma);
#elif BFD_HOST_64BIT_LONG_LONG
+#ifndef __MSVCRT__
return nc + printf ("%llx", vma);
return nc + printf ("%llx", vma);
+#else
+ return nc + printf ("%I64x", vma);
+#endif
#else
return nc + print_hex_vma (vma);
#endif
#else
return nc + print_hex_vma (vma);
#endif
@@
-502,7
+506,11
@@
print_vma (bfd_vma vma, print_mode mode)
#if BFD_HOST_64BIT_LONG
return printf ("%ld", vma);
#elif BFD_HOST_64BIT_LONG_LONG
#if BFD_HOST_64BIT_LONG
return printf ("%ld", vma);
#elif BFD_HOST_64BIT_LONG_LONG
+#ifndef __MSVCRT__
return printf ("%lld", vma);
return printf ("%lld", vma);
+#else
+ return printf ("%I64d", vma);
+#endif
#else
return print_dec_vma (vma, 1);
#endif
#else
return print_dec_vma (vma, 1);
#endif
@@
-514,10
+522,17
@@
print_vma (bfd_vma vma, print_mode mode)
else
return printf ("%#lx", vma);
#elif BFD_HOST_64BIT_LONG_LONG
else
return printf ("%#lx", vma);
#elif BFD_HOST_64BIT_LONG_LONG
+#ifndef __MSVCRT__
if (vma <= 99999)
return printf ("%5lld", vma);
else
return printf ("%#llx", vma);
if (vma <= 99999)
return printf ("%5lld", vma);
else
return printf ("%#llx", vma);
+#else
+ if (vma <= 99999)
+ return printf ("%5I64d", vma);
+ else
+ return printf ("%#I64x", vma);
+#endif
#else
if (vma <= 99999)
return printf ("%5ld", _bfd_int64_low (vma));
#else
if (vma <= 99999)
return printf ("%5ld", _bfd_int64_low (vma));
@@
-529,7
+544,11
@@
print_vma (bfd_vma vma, print_mode mode)
#if BFD_HOST_64BIT_LONG
return printf ("%lu", vma);
#elif BFD_HOST_64BIT_LONG_LONG
#if BFD_HOST_64BIT_LONG
return printf ("%lu", vma);
#elif BFD_HOST_64BIT_LONG_LONG
+#ifndef __MSVCRT__
return printf ("%llu", vma);
return printf ("%llu", vma);
+#else
+ return printf ("%I64u", vma);
+#endif
#else
return print_dec_vma (vma, 0);
#endif
#else
return print_dec_vma (vma, 0);
#endif
@@
-990,10
+1009,17
@@
dump_relocations (FILE *file,
: "%12.12lx %12.12lx ",
offset, info);
#elif BFD_HOST_64BIT_LONG_LONG
: "%12.12lx %12.12lx ",
offset, info);
#elif BFD_HOST_64BIT_LONG_LONG
+#ifndef __MSVCRT__
printf (do_wide
? "%16.16llx %16.16llx "
: "%12.12llx %12.12llx ",
offset, info);
printf (do_wide
? "%16.16llx %16.16llx "
: "%12.12llx %12.12llx ",
offset, info);
+#else
+ printf (do_wide
+ ? "%16.16I64x %16.16I64x "
+ : "%12.12I64x %12.12I64x ",
+ offset, info);
+#endif
#else
printf (do_wide
? "%8.8lx%8.8lx %8.8lx%8.8lx "
#else
printf (do_wide
? "%8.8lx%8.8lx %8.8lx%8.8lx "
@@
-2194,6
+2220,8
@@
get_machine_flags (unsigned e_flags, unsigned e_machine)
case E_MIPS_MACH_5500: strcat (buf, ", 5500"); break;
case E_MIPS_MACH_SB1: strcat (buf, ", sb1"); break;
case E_MIPS_MACH_9000: strcat (buf, ", 9000"); break;
case E_MIPS_MACH_5500: strcat (buf, ", 5500"); break;
case E_MIPS_MACH_SB1: strcat (buf, ", sb1"); break;
case E_MIPS_MACH_9000: strcat (buf, ", 9000"); break;
+ case E_MIPS_MACH_LS2E: strcat (buf, ", loongson-2e"); break;
+ case E_MIPS_MACH_LS2F: strcat (buf, ", loongson-2f"); break;
case 0:
/* We simply ignore the field in this case to avoid confusion:
MIPS ELF does not specify EF_MIPS_MACH, it is a GNU
case 0:
/* We simply ignore the field in this case to avoid confusion:
MIPS ELF does not specify EF_MIPS_MACH, it is a GNU
@@
-4134,6
+4162,16
@@
process_section_headers (FILE *file)
eh_addr_size = 4;
break;
}
eh_addr_size = 4;
break;
}
+ break;
+
+ case EM_M32C:
+ switch (elf_header.e_flags & EF_M32C_CPU_MASK)
+ {
+ case EF_M32C_CPU_M16C:
+ eh_addr_size = 2;
+ break;
+ }
+ break;
}
#define CHECK_ENTSIZE_VALUES(section, i, size32, size64) \
}
#define CHECK_ENTSIZE_VALUES(section, i, size32, size64) \
@@
-7818,7
+7856,11
@@
dump_section_as_strings (Elf_Internal_Shdr *section, FILE *file)
if (data < end)
{
if (data < end)
{
+#ifndef __MSVCRT__
printf (" [%6tx] %s\n", data - start, data);
printf (" [%6tx] %s\n", data - start, data);
+#else
+ printf (" [%6Ix] %s\n", (size_t) (data - start), data);
+#endif
data += strlen (data);
some_strings_shown = TRUE;
}
data += strlen (data);
some_strings_shown = TRUE;
}
@@
-8013,6
+8055,9
@@
is_32bit_abs_reloc (unsigned int reloc_type)
return reloc_type == 1; /* R_MSP43_32. */
case EM_MT:
return reloc_type == 2; /* R_MT_32. */
return reloc_type == 1; /* R_MSP43_32. */
case EM_MT:
return reloc_type == 2; /* R_MT_32. */
+ case EM_ALTERA_NIOS2:
+ case EM_NIOS32:
+ return reloc_type == 1; /* R_NIOS_32. */
case EM_OPENRISC:
case EM_OR32:
return reloc_type == 1; /* R_OR32_32. */
case EM_OPENRISC:
case EM_OR32:
return reloc_type == 1; /* R_OR32_32. */
@@
-8039,6
+8084,8
@@
is_32bit_abs_reloc (unsigned int reloc_type)
case EM_SPARC:
return reloc_type == 3 /* R_SPARC_32. */
|| reloc_type == 23; /* R_SPARC_UA32. */
case EM_SPARC:
return reloc_type == 3 /* R_SPARC_32. */
|| reloc_type == 23; /* R_SPARC_UA32. */
+ case EM_SPU:
+ return reloc_type == 6; /* R_SPU_ADDR32 */
case EM_CYGNUS_V850:
case EM_V850:
return reloc_type == 6; /* R_V850_ABS32. */
case EM_CYGNUS_V850:
case EM_V850:
return reloc_type == 6; /* R_V850_ABS32. */
@@
-8052,10
+8099,6
@@
is_32bit_abs_reloc (unsigned int reloc_type)
case EM_XTENSA:
return reloc_type == 1; /* R_XTENSA_32. */
case EM_XTENSA:
return reloc_type == 1; /* R_XTENSA_32. */
- case EM_ALTERA_NIOS2:
- /* Fall through (what reloc type is used ?). */
- case EM_NIOS32:
- /* Fall through (what reloc type is used ?). */
default:
error (_("Missing knowledge of 32-bit reloc types used in DWARF sections of machine number %d\n"),
elf_header.e_machine);
default:
error (_("Missing knowledge of 32-bit reloc types used in DWARF sections of machine number %d\n"),
elf_header.e_machine);
@@
-8073,30
+8116,35
@@
is_32bit_pcrel_reloc (unsigned int reloc_type)
{
case EM_386:
case EM_486:
{
case EM_386:
case EM_486:
- return reloc_type == 2; /* R_386_PC32. */
+ return reloc_type == 2;
/* R_386_PC32. */
case EM_68K:
case EM_68K:
- return reloc_type == 4; /* R_68K_PC32. */
+ return reloc_type == 4;
/* R_68K_PC32. */
case EM_ALPHA:
return reloc_type == 10; /* R_ALPHA_SREL32. */
case EM_ARM:
case EM_ALPHA:
return reloc_type == 10; /* R_ALPHA_SREL32. */
case EM_ARM:
- return reloc_type == 3; /* R_ARM_REL32 */
+ return reloc_type == 3;
/* R_ARM_REL32 */
case EM_PARISC:
case EM_PARISC:
- return reloc_type == 0; /* R_PARISC_NONE. *//* FIXME: This reloc is generated, but it may be a bug. */
+ return reloc_type == 0;
/* R_PARISC_NONE. *//* FIXME: This reloc is generated, but it may be a bug. */
case EM_PPC:
return reloc_type == 26; /* R_PPC_REL32. */
case EM_PPC64:
case EM_PPC:
return reloc_type == 26; /* R_PPC_REL32. */
case EM_PPC64:
- return reloc_type == 26;
/* R_PPC64_REL32. */
+ return reloc_type == 26; /* R_PPC64_REL32. */
case EM_S390_OLD:
case EM_S390:
case EM_S390_OLD:
case EM_S390:
- return reloc_type == 5; /* R_390_PC32. */
+ return reloc_type == 5;
/* R_390_PC32. */
case EM_SH:
case EM_SH:
- return reloc_type == 2; /* R_SH_REL32. */
+ return reloc_type == 2;
/* R_SH_REL32. */
case EM_SPARC32PLUS:
case EM_SPARCV9:
case EM_SPARC:
case EM_SPARC32PLUS:
case EM_SPARCV9:
case EM_SPARC:
- return reloc_type == 6; /* R_SPARC_DISP32. */
+ return reloc_type == 6; /* R_SPARC_DISP32. */
+ case EM_SPU:
+ return reloc_type == 13; /* R_SPU_REL32. */
case EM_X86_64:
case EM_X86_64:
- return reloc_type == 2; /* R_X86_64_PC32. */
+ return reloc_type == 2; /* R_X86_64_PC32. */
+ case EM_XTENSA_OLD:
+ case EM_XTENSA:
+ return reloc_type == 14; /* R_XTENSA_32_PCREL. */
default:
/* Do not abort or issue an error message here. Not all targets use
pc-relative 32-bit relocs in their DWARF debug information and we
default:
/* Do not abort or issue an error message here. Not all targets use
pc-relative 32-bit relocs in their DWARF debug information and we
@@
-8119,6
+8167,8
@@
is_64bit_abs_reloc (unsigned int reloc_type)
return reloc_type == 2; /* R_ALPHA_REFQUAD. */
case EM_IA_64:
return reloc_type == 0x27; /* R_IA64_DIR64LSB. */
return reloc_type == 2; /* R_ALPHA_REFQUAD. */
case EM_IA_64:
return reloc_type == 0x27; /* R_IA64_DIR64LSB. */
+ case EM_PARISC:
+ return reloc_type == 80; /* R_PARISC_DIR64. */
case EM_PPC64:
return reloc_type == 38; /* R_PPC64_ADDR64. */
case EM_SPARC32PLUS:
case EM_PPC64:
return reloc_type == 38; /* R_PPC64_ADDR64. */
case EM_SPARC32PLUS:
@@
-8127,6
+8177,9
@@
is_64bit_abs_reloc (unsigned int reloc_type)
return reloc_type == 54; /* R_SPARC_UA64. */
case EM_X86_64:
return reloc_type == 1; /* R_X86_64_64. */
return reloc_type == 54; /* R_SPARC_UA64. */
case EM_X86_64:
return reloc_type == 1; /* R_X86_64_64. */
+ case EM_S390_OLD:
+ case EM_S390:
+ return reloc_type == 22; /* R_S390_64 */
default:
return FALSE;
}
default:
return FALSE;
}
@@
-8153,9
+8206,14
@@
is_16bit_abs_reloc (unsigned int reloc_type)
case EM_IP2K_OLD:
case EM_IP2K:
return reloc_type == 1; /* R_IP2K_16. */
case EM_IP2K_OLD:
case EM_IP2K:
return reloc_type == 1; /* R_IP2K_16. */
+ case EM_M32C:
+ return reloc_type == 1; /* R_M32C_16 */
case EM_MSP430_OLD:
case EM_MSP430:
return reloc_type == 5; /* R_MSP430_16_BYTE. */
case EM_MSP430_OLD:
case EM_MSP430:
return reloc_type == 5; /* R_MSP430_16_BYTE. */
+ case EM_ALTERA_NIOS2:
+ case EM_NIOS32:
+ return reloc_type == 9; /* R_NIOS_16. */
default:
return FALSE;
}
default:
return FALSE;
}
@@
-8277,7
+8335,7
@@
debug_apply_relocations (void *file,
{
warn (_("skipping unexpected symbol type %s in %ld'th relocation in section %s\n"),
get_symbol_type (ELF_ST_TYPE (sym->st_info)),
{
warn (_("skipping unexpected symbol type %s in %ld'th relocation in section %s\n"),
get_symbol_type (ELF_ST_TYPE (sym->st_info)),
-
rp - relocs
,
+
(long int)(rp - relocs)
,
SECTION_NAME (relsec));
continue;
}
SECTION_NAME (relsec));
continue;
}
@@
-8833,6
+8891,9
@@
display_mips_gnu_attribute (unsigned char *p, int tag)
case 3:
printf ("Soft float\n");
break;
case 3:
printf ("Soft float\n");
break;
+ case 4:
+ printf ("64-bit float (-mips32r2 -mfp64)\n");
+ break;
default:
printf ("??? (%d)\n", val);
break;
default:
printf ("??? (%d)\n", val);
break;
This page took
0.027675 seconds
and
4
git commands to generate.