aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog11
-rw-r--r--gas/config/tc-v850.c36
-rw-r--r--gas/config/tc-v850.h8
-rw-r--r--gas/doc/c-v850.texi23
4 files changed, 68 insertions, 10 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ce6c114..32998bb 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -11,6 +11,17 @@
options.
* doc/c-rx.texi: Document -mgcc-abi and -mrx-abi.
+ * config/tc-v850.c (v850_target_arch): New.
+ (v850_target_format): New.
+ (set_machine): Use v850_target_arch.
+ (md_begin): Likewise.
+ (md_show_usage): Document new switches.
+ (md_parse_option): Add -mgcc-abi, -mrh850-abi, -m8byte-align and
+ -m4byte-align.
+ * config/tc-v850.c (TARGET_ARCH) Use v850_target_arch.
+ (TARGET_FORMAT): Use v850_target_format.
+ * doc/c-v850.texi: Document new options.
+
2012-11-09 David Holsgrove <david.holsgrove@xilinx.com>
* gas/microblaze/endian.exp: New file - endian testcase for microblaze / microblazeel.
diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index 4c1428b..7053e93 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -1,6 +1,6 @@
/* tc-v850.c -- Assembler code for the NEC V850
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ 2006, 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -38,6 +38,12 @@ static bfd_boolean warn_unsigned_overflows = FALSE;
/* Indicates the target BFD machine number. */
static int machine = -1;
+
+/* Indiciates the target BFD architecture. */
+int v850_target_arch = bfd_arch_v850_rh850;
+const char * v850_target_format = "elf32-v850-rh850";
+static flagword v850_e_flags = 0;
+
/* Indicates the target processor(s) for the assemble. */
static int processor_mask = 0;
@@ -512,7 +518,7 @@ static void
set_machine (int number)
{
machine = number;
- bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine);
+ bfd_set_arch_mach (stdoutput, v850_target_arch, machine);
switch (machine)
{
@@ -1338,6 +1344,10 @@ md_show_usage (FILE *stream)
fprintf (stream, _(" -mextension enable extension opcode support\n"));
fprintf (stream, _(" -mno-bcond17 disable b<cond> disp17 instruction\n"));
fprintf (stream, _(" -mno-stld23 disable st/ld offset23 instruction\n"));
+ fprintf (stream, _(" -mgcc-abi Mark the binary as using the old GCC ABI\n"));
+ fprintf (stream, _(" -mrh850-abi Mark the binary as using the RH850 ABI (default)\n"));
+ fprintf (stream, _(" -m8byte-align Mark the binary as using 64-bit alignment\n"));
+ fprintf (stream, _(" -m4byte-align Mark the binary as using 32-bit alignment (default)\n"));
}
int
@@ -1403,6 +1413,20 @@ md_parse_option (int c, char *arg)
}
else if (strcmp (arg, "relax") == 0)
v850_relax = 1;
+ else if (strcmp (arg, "gcc-abi") == 0)
+ {
+ v850_target_arch = bfd_arch_v850;
+ v850_target_format = "elf32-v850";
+ }
+ else if (strcmp (arg, "rh850-abi") == 0)
+ {
+ v850_target_arch = bfd_arch_v850_rh850;
+ v850_target_format = "elf32-v850-rh850";
+ }
+ else if (strcmp (arg, "8byte-align") == 0)
+ v850_e_flags |= EF_RH850_DATA_ALIGN8;
+ else if (strcmp (arg, "4byte-align") == 0)
+ v850_e_flags &= ~ EF_RH850_DATA_ALIGN8;
else
return 0;
@@ -1673,7 +1697,8 @@ md_begin (void)
}
v850_seg_table[BSS_SECTION].s = bss_section;
- bfd_set_arch_mach (stdoutput, TARGET_ARCH, machine);
+ bfd_set_arch_mach (stdoutput, v850_target_arch, machine);
+ bfd_set_private_flags (stdoutput, v850_e_flags);
}
@@ -1996,7 +2021,7 @@ md_assemble (char *str)
int relaxable = 0;
unsigned long insn;
unsigned long insn_size;
- char *f;
+ char *f = NULL;
int i;
int match;
bfd_boolean extra_data_after_insn = FALSE;
@@ -3219,7 +3244,8 @@ md_apply_fix (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED)
break;
case BFD_RELOC_V850_16_PCREL:
- bfd_putl16 (-value & 0xfffe, (unsigned char *) where);
+ bfd_putl16 ((-value & 0xfffe) | (bfd_getl16 (where + 2) & 0x0001),
+ (unsigned char *) (where + 2));
break;
case BFD_RELOC_V850_22_PCREL:
diff --git a/gas/config/tc-v850.h b/gas/config/tc-v850.h
index b666b21..2762770 100644
--- a/gas/config/tc-v850.h
+++ b/gas/config/tc-v850.h
@@ -1,5 +1,5 @@
/* tc-v850.h -- Header file for tc-v850.c.
- Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006, 2007
+ Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2012
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -26,10 +26,12 @@
#define TARGET_BYTES_BIG_ENDIAN 0
/* The target BFD architecture. */
-#define TARGET_ARCH bfd_arch_v850
+#define TARGET_ARCH v850_target_arch
+extern int v850_target_arch;
/* The target BFD format. */
-#define TARGET_FORMAT "elf32-v850"
+#define TARGET_FORMAT v850_target_format
+extern const char * v850_target_format;
#define md_operand(x)
diff --git a/gas/doc/c-v850.texi b/gas/doc/c-v850.texi
index 1eb16d7..53fef5f 100644
--- a/gas/doc/c-v850.texi
+++ b/gas/doc/c-v850.texi
@@ -1,4 +1,4 @@
-@c Copyright 1997, 2002, 2003, 2006, 2011 Free Software Foundation, Inc.
+@c Copyright 1997, 2002, 2003, 2006, 2011, 2012 Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@@ -88,8 +88,27 @@ of code which are either a long function call or a long branch. The
assembler will then flag these sections of code and the linker will
attempt to relax them.
-@end table
+@cindex @code{-mgcc-abi} command line option, V850
+@item -mgcc-abi
+Marks the generated objecy file as supporting the old GCC ABI.
+
+@cindex @code{-mrh850-abi} command line option, V850
+@item -mrh850-abi
+Marks the generated objecy file as supporting the RH850 ABI. This is
+the default.
+
+@cindex @code{-m8byte-align} command line option, V850
+@item -m8byte-align
+Marks the generated objecy file as supporting a maximum 64-bits of
+alignment for variables defined in the source code.
+@cindex @code{-m4byte-align} command line option, V850
+@item -m4byte-align
+Marks the generated objecy file as supporting a maximum 32-bits of
+alignment for variables defined in the source code. This is the
+default.
+
+@end table
@node V850 Syntax
@section Syntax