#define RELOC_MACROS_GEN_FUNC
+#include "elf/aarch64.h"
#include "elf/alpha.h"
#include "elf/arc.h"
#include "elf/arm.h"
/* Targets that use RELA relocations. */
case EM_68K:
case EM_860:
+ case EM_AARCH64:
case EM_ADAPTEVA_EPIPHANY:
case EM_ALPHA:
case EM_ALTERA_NIOS2:
rtype = NULL;
break;
+ case EM_AARCH64:
+ rtype = elf_aarch64_reloc_type (type);
+ break;
+
case EM_M32R:
case EM_CYGNUS_M32R:
rtype = elf_m32r_reloc_type (type);
switch (e_machine)
{
case EM_NONE: return _("None");
+ case EM_AARCH64: return "AArch64";
case EM_M32: return "WE32100";
case EM_SPARC: return "Sparc";
case EM_SPU: return "SPU";
}
}
+static const char *
+get_aarch64_segment_type (unsigned long type)
+{
+ switch (type)
+ {
+ case PT_AARCH64_ARCHEXT:
+ return "AARCH64_ARCHEXT";
+ default:
+ break;
+ }
+
+ return NULL;
+}
+
static const char *
get_arm_segment_type (unsigned long type)
{
switch (elf_header.e_machine)
{
+ case EM_AARCH64:
+ result = get_aarch64_segment_type (p_type);
+ break;
case EM_ARM:
result = get_arm_segment_type (p_type);
break;
return NULL;
}
+static const char *
+get_aarch64_section_type_name (unsigned int sh_type)
+{
+ switch (sh_type)
+ {
+ case SHT_AARCH64_ATTRIBUTES:
+ return "AARCH64_ATTRIBUTES";
+ default:
+ break;
+ }
+ return NULL;
+}
+
static const char *
get_arm_section_type_name (unsigned int sh_type)
{
case EM_K1OM:
result = get_x86_64_section_type_name (sh_type);
break;
+ case EM_AARCH64:
+ result = get_aarch64_section_type_name (sh_type);
+ break;
case EM_ARM:
result = get_arm_section_type_name (sh_type);
break;
sprintf (buff, "OS [0x%04x]", type & 0xffff);
else if (type >= SHN_LORESERVE)
sprintf (buff, "RSV[0x%04x]", type & 0xffff);
+ else if (type >= elf_header.e_shnum)
+ sprintf (buff, "bad section index[%3d]", type);
else
sprintf (buff, "%3d", type);
break;
return reloc_type == 1; /* R_860_32. */
case EM_960:
return reloc_type == 2; /* R_960_32. */
+ case EM_AARCH64:
+ return reloc_type == 258; /* R_AARCH64_ABS32 */
case EM_ALPHA:
return reloc_type == 1; /* R_ALPHA_REFLONG. */
case EM_ARC:
return reloc_type == 2; /* R_386_PC32. */
case EM_68K:
return reloc_type == 4; /* R_68K_PC32. */
+ case EM_AARCH64:
+ return reloc_type == 261; /* R_AARCH64_PREL32 */
case EM_ADAPTEVA_EPIPHANY:
return reloc_type == 6;
case EM_ALPHA:
{
switch (elf_header.e_machine)
{
+ case EM_AARCH64:
+ return reloc_type == 257; /* R_AARCH64_ABS64. */
case EM_ALPHA:
return reloc_type == 2; /* R_ALPHA_REFQUAD. */
case EM_IA_64:
{
switch (elf_header.e_machine)
{
+ case EM_AARCH64:
+ return reloc_type == 260; /* R_AARCH64_PREL64. */
case EM_ALPHA:
return reloc_type == 11; /* R_ALPHA_SREL64. */
case EM_IA_64:
case EM_XC16X:
case EM_C166: /* R_XC16X_NONE. */
return reloc_type == 0;
+ case EM_AARCH64:
+ return reloc_type == 0 || reloc_type == 256;
case EM_XTENSA_OLD:
case EM_XTENSA:
return (reloc_type == 0 /* R_XTENSA_NONE. */
static const char * arm_attr_tag_CPU_arch[] =
{"Pre-v4", "v4", "v4T", "v5T", "v5TE", "v5TEJ", "v6", "v6KZ", "v6T2",
- "v6K", "v7", "v6-M", "v6S-M", "v7E-M"};
+ "v6K", "v7", "v6-M", "v6S-M", "v7E-M", "v8"};
static const char * arm_attr_tag_ARM_ISA_use[] = {"No", "Yes"};
static const char * arm_attr_tag_THUMB_ISA_use[] =
{"No", "Thumb-1", "Thumb-2"};
static const char * arm_attr_tag_FP_arch[] =
- {"No", "VFPv1", "VFPv2", "VFPv3", "VFPv3-D16", "VFPv4", "VFPv4-D16"};
+ {"No", "VFPv1", "VFPv2", "VFPv3", "VFPv3-D16", "VFPv4", "VFPv4-D16",
+ "FP for ARMv8"};
static const char * arm_attr_tag_WMMX_arch[] = {"No", "WMMXv1", "WMMXv2"};
static const char * arm_attr_tag_Advanced_SIMD_arch[] =
- {"No", "NEONv1", "NEONv1 with Fused-MAC"};
+ {"No", "NEONv1", "NEONv1 with Fused-MAC", "NEON for ARMv8"};
static const char * arm_attr_tag_PCS_config[] =
{"None", "Bare platform", "Linux application", "Linux DSO", "PalmOS 2004",
"PalmOS (reserved)", "SymbianOS 2004", "SymbianOS (reserved)"};
return _("NT_LWPSINFO (lwpsinfo_t structure)");
case NT_WIN32PSTATUS:
return _("NT_WIN32PSTATUS (win32_pstatus structure)");
+ case NT_SIGINFO:
+ return _("NT_SIGINFO (siginfo_t data)");
+ case NT_FILE:
+ return _("NT_FILE (mapped files)");
default:
break;
}
return buff;
}
+static int
+print_core_note (Elf_Internal_Note *pnote)
+{
+ unsigned int addr_size = is_32bit_elf ? 4 : 8;
+ bfd_vma count, page_size;
+ unsigned char *descdata, *filenames, *descend;
+
+ if (pnote->type != NT_FILE)
+ return 1;
+
+#ifndef BFD64
+ if (!is_32bit_elf)
+ {
+ printf (_(" Cannot decode 64-bit note in 32-bit build\n"));
+ /* Still "successful". */
+ return 1;
+ }
+#endif
+
+ if (pnote->descsz < 2 * addr_size)
+ {
+ printf (_(" Malformed note - too short for header\n"));
+ return 0;
+ }
+
+ descdata = (unsigned char *) pnote->descdata;
+ descend = descdata + pnote->descsz;
+
+ if (descdata[pnote->descsz - 1] != '\0')
+ {
+ printf (_(" Malformed note - does not end with \\0\n"));
+ return 0;
+ }
+
+ count = byte_get (descdata, addr_size);
+ descdata += addr_size;
+
+ page_size = byte_get (descdata, addr_size);
+ descdata += addr_size;
+
+ if (pnote->descsz < 2 * addr_size + count * 3 * addr_size)
+ {
+ printf (_(" Malformed note - too short for supplied file count\n"));
+ return 0;
+ }
+
+ printf (_(" Page size: "));
+ print_vma (page_size, DEC);
+ printf ("\n");
+
+ printf (_(" %*s%*s%*s\n"),
+ (int) (2 + 2 * addr_size), _("Start"),
+ (int) (4 + 2 * addr_size), _("End"),
+ (int) (4 + 2 * addr_size), _("Page Offset"));
+ filenames = descdata + count * 3 * addr_size;
+ while (--count > 0)
+ {
+ bfd_vma start, end, file_ofs;
+
+ if (filenames == descend)
+ {
+ printf (_(" Malformed note - filenames end too early\n"));
+ return 0;
+ }
+
+ start = byte_get (descdata, addr_size);
+ descdata += addr_size;
+ end = byte_get (descdata, addr_size);
+ descdata += addr_size;
+ file_ofs = byte_get (descdata, addr_size);
+ descdata += addr_size;
+
+ printf (" ");
+ print_vma (start, FULL_HEX);
+ printf (" ");
+ print_vma (end, FULL_HEX);
+ printf (" ");
+ print_vma (file_ofs, FULL_HEX);
+ printf ("\n %s\n", filenames);
+
+ filenames += 1 + strlen ((char *) filenames);
+ }
+
+ return 1;
+}
+
static const char *
get_gnu_elf_note_type (unsigned e_type)
{
return print_gnu_note (pnote);
else if (const_strneq (pnote->namedata, "stapsdt"))
return print_stapsdt_note (pnote);
+ else if (const_strneq (pnote->namedata, "CORE"))
+ return print_core_note (pnote);
else
return 1;
}