+2012-11-09 Nick Clifton <nickc@redhat.com>
+
+ * elf32-rx.c (describe_flags): New function. Returns a buffer
+ containing a description of the E_FLAG_RX_... values set.
+ (rx_elf_merge_private_bfd_data): Use it.
+ (rx_elf_print_private_bfd_data): Likewise.
+ (elf32_rx_machine): Skip EF_RX_CPU_RX check.
+ (elf32_rx_special_sections): Define.
+ (elf_backend_special_sections): Define.
+
2012-11-09 Edgar E. Iglesias <edgar.iglesias@gmail.com>
* config.bfd: Add microblazeel-*-*
ignore_lma = user_ignore_lma;
}
+/* Converts FLAGS into a descriptive string.
+ Returns a static pointer. */
+
+static const char *
+describe_flags (flagword flags)
+{
+ static char buf [128];
+
+ buf[0] = 0;
+
+ if (flags & E_FLAG_RX_64BIT_DOUBLES)
+ strcat (buf, "64-bit doubles");
+ else
+ strcat (buf, "32-bit doubles");
+
+ if (flags & E_FLAG_RX_DSP)
+ strcat (buf, ", dsp");
+ else
+ strcat (buf, ", no dsp");
+
+ if (flags & E_FLAG_RX_PID)
+ strcat (buf, ", pid");
+ else
+ strcat (buf, ", no pid");
+
+ if (flags & E_FLAG_RX_ABI)
+ strcat (buf, ", RX ABI");
+ else
+ strcat (buf, ", GCC ABI");
+
+ return buf;
+}
+
/* Merge backend specific data from an object file to the output
object file when linking. */
}
else if (old_flags != new_flags)
{
- flagword known_flags = E_FLAG_RX_64BIT_DOUBLES | E_FLAG_RX_DSP | E_FLAG_RX_PID;
+ flagword known_flags;
+
+ known_flags = E_FLAG_RX_ABI | E_FLAG_RX_64BIT_DOUBLES
+ | E_FLAG_RX_DSP | E_FLAG_RX_PID;
if ((old_flags ^ new_flags) & known_flags)
{
}
else
{
- (*_bfd_error_handler)
- ("ELF header flags mismatch: old_flags = 0x%.8lx, new_flags = 0x%.8lx, filename = %s",
- old_flags, new_flags, bfd_get_filename (ibfd));
+ _bfd_error_handler ("There is a conflict merging the ELF header flags from %s",
+ bfd_get_filename (ibfd));
+ _bfd_error_handler (" the input file's flags: %s",
+ describe_flags (new_flags));
+ _bfd_error_handler (" the output file's flags: %s",
+ describe_flags (old_flags));
error = TRUE;
}
}
flags = elf_elfheader (abfd)->e_flags;
fprintf (file, _("private flags = 0x%lx:"), (long) flags);
- if (flags & E_FLAG_RX_64BIT_DOUBLES)
- fprintf (file, _(" [64-bit doubles]"));
- if (flags & E_FLAG_RX_DSP)
- fprintf (file, _(" [dsp]"));
-
- fputc ('\n', file);
+ fprintf (file, describe_flags (flags));
return TRUE;
}
/* Return the MACH for an e_flags value. */
static int
-elf32_rx_machine (bfd * abfd)
+elf32_rx_machine (bfd * abfd ATTRIBUTE_UNUSED)
{
+#if 0 /* FIXME: EF_RX_CPU_MASK collides with E_FLAG_RX_...
+ Need to sort out how these flag bits are used.
+ For now we assume that the flags are OK. */
if ((elf_elfheader (abfd)->e_flags & EF_RX_CPU_MASK) == EF_RX_CPU_RX)
+#endif
return bfd_mach_rx;
return 0;
return TRUE;
}
+
+/* The default literal sections should always be marked as "code" (i.e.,
+ SHF_EXECINSTR). This is particularly important for big-endian mode
+ when we do not want their contents byte reversed. */
+static const struct bfd_elf_special_section elf32_rx_special_sections[] =
+{
+ { STRING_COMMA_LEN (".init_array"), 0, SHT_INIT_ARRAY, SHF_ALLOC + SHF_EXECINSTR },
+ { STRING_COMMA_LEN (".fini_array"), 0, SHT_FINI_ARRAY, SHF_ALLOC + SHF_EXECINSTR },
+ { STRING_COMMA_LEN (".preinit_array"), 0, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_EXECINSTR },
+ { NULL, 0, 0, 0, 0 }
+};
\f
#define ELF_ARCH bfd_arch_rx
#define ELF_MACHINE_CODE EM_RX
#define bfd_elf32_set_section_contents rx_set_section_contents
#define bfd_elf32_bfd_final_link rx_final_link
#define bfd_elf32_bfd_relax_section elf32_rx_relax_section_wrapper
+#define elf_backend_special_sections elf32_rx_special_sections
#include "elf32-target.h"
+2012-11-09 Nick Clifton <nickc@redhat.com>
+
+ * readelf.c (get_machine_flags): Add support for E_FLAG_RX_ABI.
+
2012-11-09 H.J. Lu <hongjiu.lu@intel.com>
* coffgrok.c (coff_grok): Remove trailing redundant `;'.
case EM_TI_C6000:
case EM_TILEGX:
case EM_TILEPRO:
+ case EM_V800:
case EM_V850:
case EM_CYGNUS_V850:
case EM_VAX:
rtype = elf_spu_reloc_type (type);
break;
+ case EM_V800:
+ rtype = v800_reloc_type (type);
+ break;
case EM_V850:
case EM_CYGNUS_V850:
rtype = v850_reloc_type (type);
case EM_960: return "Intel 90860";
case EM_PPC: return "PowerPC";
case EM_PPC64: return "PowerPC64";
- case EM_V800: return "NEC V800";
case EM_FR20: return "Fujitsu FR20";
case EM_RH32: return "TRW RH32";
case EM_MCORE: return "MCORE";
case EM_CYGNUS_M32R:
case EM_M32R: return "Renesas M32R (formerly Mitsubishi M32r)";
case EM_CYGNUS_V850:
+ case EM_V800: return "Renesas V850 (using RH850 ABI)";
case EM_V850: return "Renesas V850";
case EM_CYGNUS_MN10300:
case EM_MN10300: return "mn10300";
strcat (buf, _(", relocatable-lib"));
break;
+ case EM_V800:
+ if ((e_flags & EF_RH850_ABI) == EF_RH850_ABI)
+ strcat (buf, ", RH850 ABI");
+
+ if (e_flags & EF_V800_850E3)
+ strcat (buf, ", V3 architecture");
+
+ if ((e_flags & (EF_RH850_FPU_DOUBLE | EF_RH850_FPU_SINGLE)) == 0)
+ strcat (buf, ", FPU not used");
+
+ if ((e_flags & (EF_RH850_REGMODE22 | EF_RH850_REGMODE32)) == 0)
+ strcat (buf, ", regmode: COMMON");
+
+ if ((e_flags & (EF_RH850_GP_FIX | EF_RH850_GP_NOFIX)) == 0)
+ strcat (buf, ", r4 not used");
+
+ if ((e_flags & (EF_RH850_EP_FIX | EF_RH850_EP_NOFIX)) == 0)
+ strcat (buf, ", r30 not used");
+
+ if ((e_flags & (EF_RH850_TP_FIX | EF_RH850_TP_NOFIX)) == 0)
+ strcat (buf, ", r5 not used");
+
+ if ((e_flags & (EF_RH850_REG2_RESERVE | EF_RH850_REG2_NORESERVE)) == 0)
+ strcat (buf, ", r2 not used");
+
+ for (e_flags &= 0xFFFF; e_flags; e_flags &= ~ (e_flags & - e_flags))
+ {
+ switch (e_flags & - e_flags)
+ {
+ case EF_RH850_FPU_DOUBLE: strcat (buf, ", double precision FPU"); break;
+ case EF_RH850_FPU_SINGLE: strcat (buf, ", single precision FPU"); break;
+ case EF_RH850_SIMD: strcat (buf, ", SIMD"); break;
+ case EF_RH850_CACHE: strcat (buf, ", CACHE"); break;
+ case EF_RH850_MMU: strcat (buf, ", MMU"); break;
+ case EF_RH850_REGMODE22: strcat (buf, ", regmode:22"); break;
+ case EF_RH850_REGMODE32: strcat (buf, ", regmode:23"); break;
+ case EF_RH850_DATA_ALIGN8: strcat (buf, ", 8-byte alignment"); break;
+ case EF_RH850_GP_FIX: strcat (buf, ", r4 fixed"); break;
+ case EF_RH850_GP_NOFIX: strcat (buf, ", r4 free"); break;
+ case EF_RH850_EP_FIX: strcat (buf, ", r30 fixed"); break;
+ case EF_RH850_EP_NOFIX: strcat (buf, ", r30 free"); break;
+ case EF_RH850_TP_FIX: strcat (buf, ", r5 fixed"); break;
+ case EF_RH850_TP_NOFIX: strcat (buf, ", r5 free"); break;
+ case EF_RH850_REG2_RESERVE: strcat (buf, ", r2 fixed"); break;
+ case EF_RH850_REG2_NORESERVE: strcat (buf, ", r2 free"); break;
+ default: break;
+ }
+ }
+ break;
+
case EM_V850:
case EM_CYGNUS_V850:
switch (e_flags & EF_V850_ARCH)
strcat (buf, ", dsp");
if (e_flags & E_FLAG_RX_PID)
strcat (buf, ", pid");
+ if (e_flags & E_FLAG_RX_ABI)
+ strcat (buf, ", RX ABI");
break;
case EM_S390:
case EM_CYGNUS_V850:
case EM_V850:
return reloc_type == 6; /* R_V850_ABS32. */
+ case EM_V800:
+ return reloc_type == 0x33; /* R_V810_WORD. */
case EM_VAX:
return reloc_type == 1; /* R_VAX_32. */
case EM_X86_64:
+2012-11-09 Nick Clifton <nickc@redhat.com>
+
+ * config/obj-elf.c (obj_elf_change_section): Allow init array
+ sections to have the SHF_EXECINSTR attribute for the RX target.
+ * config/tc-rx.c (elf_flags): Initialise with E_FLAG_RX_ABI.
+ (enum options): Add OPTION_USES_GCC_ABI and OPTION_USES_RX_ABI.
+ (md_longopts): Add -mgcc-abi and -mrx-abi.
+ (md_parse_option): Add support for OPTION_USES_GCC_ABI and
+ OPTION_USES_RX_ABI.
+ * doc/as.texinfo (RX Options): Add mention of remaining RX
+ options.
+ * doc/c-rx.texi: Document -mgcc-abi and -mrx-abi.
+
2012-11-09 David Holsgrove <david.holsgrove@xilinx.com>
* gas/microblaze/endian.exp: New file - endian testcase for microblaze / microblazeel.
/* A section on Alpha may have SHF_ALPHA_GPREL. */
else if ((attr & ~ssect->attr) == SHF_ALPHA_GPREL)
override = TRUE;
+#endif
+#ifdef TC_RX
+ else if (attr == (SHF_EXECINSTR | SHF_WRITE | SHF_ALLOC)
+ && (ssect->type == SHT_INIT_ARRAY
+ || ssect->type == SHT_FINI_ARRAY
+ || ssect->type == SHT_PREINIT_ARRAY))
+ /* RX init/fini arrays can and should have the "awx" attributes set. */
+ ;
#endif
else
{
const char FLT_CHARS[] = "dD";
\f
/* ELF flags to set in the output file header. */
-static int elf_flags = 0;
+static int elf_flags = E_FLAG_RX_ABI;
bfd_boolean rx_use_conventional_section_names = FALSE;
static bfd_boolean rx_use_small_data_limit = FALSE;
OPTION_RELAX,
OPTION_PID,
OPTION_INT_REGS,
+ OPTION_USES_GCC_ABI,
+ OPTION_USES_RX_ABI,
};
#define RX_SHORTOPTS ""
{"relax", no_argument, NULL, OPTION_RELAX},
{"mpid", no_argument, NULL, OPTION_PID},
{"mint-register", required_argument, NULL, OPTION_INT_REGS},
+ {"mgcc-abi", no_argument, NULL, OPTION_USES_GCC_ABI},
+ {"mrx-abi", no_argument, NULL, OPTION_USES_RX_ABI},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
case OPTION_INT_REGS:
rx_num_int_regs = atoi (optarg);
return 1;
+
+ case OPTION_USES_GCC_ABI:
+ elf_flags &= ~ E_FLAG_RX_ABI;
+ return 1;
+
+ case OPTION_USES_RX_ABI:
+ elf_flags |= E_FLAG_RX_ABI;
+ return 1;
}
return 0;
}
@emph{Target RX options:}
[@b{-mlittle-endian}|@b{-mbig-endian}]
[@b{-m32bit-doubles}|@b{-m64bit-doubles}]
+ [@b{-muse-conventional-section-names}]
+ [@b{-msmall-data-limit}]
+ [@b{-mpid}]
+ [@b{-mrelax}]
+ [@b{-mint-register=@var{number}}]
+ [@b{-mgcc-abi}|@b{-mrx-abi}]
@end ifset
@ifset S390
for use by interrupt handlers. This is needed in order to compute the
correct values for the @code{%gpreg} and @code{%pidreg} meta registers.
+@cindex @samp{-mgcc-abi}
+@item -mgcc-abi
+This option tells the assembler that the old GCC ABI is being used by
+the assembled code. With this version of the ABI function arguments
+that are passed on the stack are aligned to a 32-bit boundary.
+
+@cindex @samp{-mrx-abi}
+@item -mrx-abi
+This option tells the assembler that the official RX ABI is being used
+by the assembled code. With this version of the ABI function
+arguments that are passed on the stack are aligned to their natural
+alignments. This option is the default.
+
@end table
@node RX-Modifiers
+2012-11-09 Nick Clifton <nickc@redhat.com>
+
+ * rx.h (EF_RX_CPU_RX): Add comment.
+ (E_FLAG_RX_ABI): Define.
+
2012-11-08 Maciej W. Rozycki <macro@codesourcery.com>
* mips.h (EF_MIPS_32BITMODE): Move next to lower-order bits.
END_RELOC_NUMBERS (R_RX_max)
-#define EF_RX_CPU_RX 0x00000079 /* FIXME: correct value? */
+#define EF_RX_CPU_RX 0x00000079 /* FIXME: this collides with the E_FLAG_RX_... values below. */
#define EF_RX_CPU_MASK 0x0000007F /* specific cpu bits. */
#define EF_RX_ALL_FLAGS (EF_RX_CPU_MASK)
#define E_FLAG_RX_64BIT_DOUBLES (1 << 0)
#define E_FLAG_RX_DSP (1 << 1) /* Defined in the RX CPU Object file specification, but not explained. */
#define E_FLAG_RX_PID (1 << 2) /* Unofficial - DJ */
+#define E_FLAG_RX_ABI (1 << 3) /* Binary passes stacked arguments using natural alignment. Unofficial - NC. */
/* These define the addend field of R_RX_RH_RELAX relocations. */
#define RX_RELAXA_IMM6 0x00000010 /* Imm8/16/24/32 at bit offset 6. */
+2012-11-09 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/rxelf.em (no_flag_mismatch_warnings): Initialise to
+ true.
+ (PARSE_AND_LIST_LONGOPTS): Add flag-mismatch-warnings.
+ (PARSE_AND_LIST_ARG_CASES): Add support for
+ --flag-mismatch-warnings.
+
2012-11-09 Edgar E. Iglesias <edgar.iglesias@gmail.com>
* Makefile.am: Add eelf32microblazeel.c and eelf32mbel_linux.c.
test -z "$TARGET2_TYPE" && TARGET2_TYPE="rel"
fragment <<EOF
-static bfd_boolean no_flag_mismatch_warnings = FALSE;
+static bfd_boolean no_flag_mismatch_warnings = TRUE;
static bfd_boolean ignore_lma = TRUE;
/* This is a convenient point to tell BFD about target specific flags.
#define OPTION_NO_FLAG_MISMATCH_WARNINGS 301
#define OPTION_IGNORE_LMA 302
#define OPTION_NO_IGNORE_LMA 303
+#define OPTION_FLAG_MISMATCH_WARNINGS 304
'
PARSE_AND_LIST_LONGOPTS='
{ "no-flag-mismatch-warnings", no_argument, NULL, OPTION_NO_FLAG_MISMATCH_WARNINGS},
+ { "flag-mismatch-warnings", no_argument, NULL, OPTION_FLAG_MISMATCH_WARNINGS},
{ "ignore-lma", no_argument, NULL, OPTION_IGNORE_LMA},
{ "no-ignore-lma", no_argument, NULL, OPTION_NO_IGNORE_LMA},
'
PARSE_AND_LIST_OPTIONS='
fprintf (file, _(" --no-flag-mismatch-warnings Don'\''t warn about objects with incompatible\n"
" endian or dsp settings\n"));
+ fprintf (file, _(" --flag-mismatch-warnings Warn about objects with incompatible\n"
+ " endian, dsp or ABI settings\n"));
fprintf (file, _(" --ignore-lma Ignore segment LMAs [default]\n"
" (for Renesas Tools compatibility)\n"));
fprintf (file, _(" --no-ignore-lma Don'\''t ignore segment LMAs\n"));
no_flag_mismatch_warnings = TRUE;
break;
+ case OPTION_FLAG_MISMATCH_WARNINGS:
+ no_flag_mismatch_warnings = FALSE;
+ break;
+
case OPTION_IGNORE_LMA:
ignore_lma = TRUE;
break;