* config/obj-evax.h (S_SET_OTHER, S_SET_TYPE, S_SET_DESC): Don't define.
[deliverable/binutils-gdb.git] / gas / config / tc-m68k.c
index 5a2c73c4bf9e4cfe62251e02aec328c9d5d80c67..20852f8653ac971ec9a4bfe287be80c254e5db64 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-m68k.c -- Assemble for the m68k family
    Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -186,7 +186,7 @@ static const enum m68k_register mcf51_ctrl[] = {
   0
 };
 static const enum m68k_register mcf5206_ctrl[] = {
-  CACR, ACR0, ACR1,  VBR, RAMBAR0, RAMBAR_ALT, MBAR,
+  CACR, ACR0, ACR1, VBR, RAMBAR0, RAMBAR_ALT, MBAR,
   0
 };
 static const enum m68k_register mcf5208_ctrl[] = {
@@ -205,8 +205,12 @@ static const enum m68k_register mcf5216_ctrl[] = {
   VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, RAMBAR1,
   0
 };
+static const enum m68k_register mcf5221x_ctrl[] = {
+  VBR, FLASHBAR, RAMBAR, RAMBAR1,
+  0
+};
 static const enum m68k_register mcf52223_ctrl[] = {
-  VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, RAMBAR1,
+  VBR, FLASHBAR, RAMBAR, RAMBAR1,
   0
 };
 static const enum m68k_register mcf52235_ctrl[] = {
@@ -298,13 +302,22 @@ static const enum m68k_register mcf5407_ctrl[] = {
   MBAR1 /* MBAR */, RAMBAR /* RAMBAR1 */,
   0
 };
+static const enum m68k_register mcf54418_ctrl[] = {
+  CACR, ASID, ACR0, ACR1, ACR2, ACR3, ACR4, ACR5, ACR6, ACR7, MMUBAR, RGPIOBAR,
+  VBR, PC, RAMBAR1,
+  /* Legacy names */
+  TC /* ASID */, BUSCR /* MMUBAR */,
+  ITT0 /* ACR0 */, ITT1 /* ACR1 */, DTT0 /* ACR2 */, DTT1 /* ACR3 */,
+  RAMBAR /* RAMBAR1 */,
+  0
+};
 static const enum m68k_register mcf54455_ctrl[] = {
   CACR, ASID, ACR0, ACR1, ACR2, ACR3, MMUBAR,
-  VBR, PC, RAMBAR1, MBAR,
+  VBR, PC, RAMBAR1,
   /* Legacy names */
   TC /* ASID */, BUSCR /* MMUBAR */,
   ITT0 /* ACR0 */, ITT1 /* ACR1 */, DTT0 /* ACR2 */, DTT1 /* ACR3 */,
-  MBAR1 /* MBAR */,  RAMBAR /* RAMBAR1 */,
+  RAMBAR /* RAMBAR1 */,
   0
 };
 static const enum m68k_register mcf5475_ctrl[] = {
@@ -622,6 +635,8 @@ static const struct m68k_cpu m68k_cpus[] =
   {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5216_ctrl, "5216", 0},
   {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5216_ctrl, "521x", 2},
 
+  {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp,   mcf5221x_ctrl, "5221x", 0},
+
   {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp,   mcf52223_ctrl, "52221", -1},
   {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp,   mcf52223_ctrl, "52223", 0},
 
@@ -687,6 +702,12 @@ static const struct m68k_cpu m68k_cpus[] =
   
   {mcfisa_a|mcfisa_b|mcfhwdiv|mcfmac,          mcf5407_ctrl, "5407",0},
 
+  {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp,   mcf54418_ctrl, "54410", -1},
+  {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp,   mcf54418_ctrl, "54415", -1},
+  {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp,   mcf54418_ctrl, "54416", -1},
+  {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp,   mcf54418_ctrl, "54417", -1},
+  {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp,   mcf54418_ctrl, "54418", 0},
+
   {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp,   mcf54455_ctrl, "54450", -1},
   {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp,   mcf54455_ctrl, "54451", -1},
   {mcfisa_a|mcfisa_c|mcfhwdiv|mcfemac|mcfusp,   mcf54455_ctrl, "54452", -1},
@@ -1320,10 +1341,29 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
           && fixp->fx_addsy
           && S_IS_WEAK (fixp->fx_addsy)
           && ! bfd_is_und_section (S_GET_SEGMENT (fixp->fx_addsy)))
-    /* PR gas/3041 Adjust addend in order to force bfd_install_relocation()
-       to put the symbol offset into frags referencing a weak symbol.  */
-    reloc->addend = fixp->fx_addnumber
-                   - (S_GET_VALUE (fixp->fx_addsy) * 2);
+    {
+      /* PR gas/3041 References to weak symbols must be treated as extern
+        in order to be overridable by the linker, even if they are defined
+        in the same object file. So the original addend must be written
+        "as is" into the output section without further processing.
+        The addend value must be hacked here in order to force
+        bfd_install_relocation() to write the original value into the
+        output section.
+        1) MD_APPLY_SYM_VALUE() is set to 1 for m68k/a.out, so the symbol
+        value has already been added to the addend in fixup_segment(). We
+        have to remove it.
+        2) bfd_install_relocation() will incorrectly treat this symbol as
+        resolved, so it will write the symbol value plus its addend and
+        section VMA. As a workaround we can tweak the addend value here in
+        order to get the original value in the section after the call to
+        bfd_install_relocation().  */
+      reloc->addend = fixp->fx_addnumber
+                     /* Fix because of MD_APPLY_SYM_VALUE() */
+                     - S_GET_VALUE (fixp->fx_addsy)
+                     /* Fix for bfd_install_relocation() */
+                     - (S_GET_VALUE (fixp->fx_addsy)
+                        + S_GET_SEGMENT (fixp->fx_addsy)->vma);
+    }
   else
     reloc->addend = 0;
 #else
@@ -3305,6 +3345,15 @@ m68k_ip (char *instring)
            case MMUBAR:
              tmpreg = 0x008;
              break;
+           case RGPIOBAR:
+             tmpreg = 0x009;
+             break;
+           case ACR4:
+           case ACR5:
+           case ACR6:
+           case ACR7:
+             tmpreg = 0x00c + (opP->reg - ACR4);
+             break;
 
            case USP:
              tmpreg = 0x800;
@@ -4100,6 +4149,10 @@ static const struct init_entry init_table[] =
   { "acr1", ACR1 },            /* Access Control Unit 1.  */
   { "acr2", ACR2 },            /* Access Control Unit 2.  */
   { "acr3", ACR3 },            /* Access Control Unit 3.  */
+  { "acr4", ACR4 },            /* Access Control Unit 4.  */
+  { "acr5", ACR5 },            /* Access Control Unit 5.  */
+  { "acr6", ACR6 },            /* Access Control Unit 6.  */
+  { "acr7", ACR7 },            /* Access Control Unit 7.  */
 
   { "tc", TC },                        /* MMU Translation Control Register.  */
   { "tcr", TC },
@@ -4145,6 +4198,8 @@ static const struct init_entry init_table[] =
 
   { "mbar2",    MBAR2 },       /* mcf5249 registers.  */
 
+  { "rgpiobar",        RGPIOBAR },     /* mcf54418 registers.  */
+
   { "cac",    CAC },           /* fido registers.  */
   { "mbb",    MBO },           /* fido registers (obsolete).  */
   { "mbo",    MBO },           /* fido registers.  */
@@ -7658,7 +7713,6 @@ md_show_usage (FILE *stream)
 {
   const char *default_cpu = TARGET_CPU;
   int i;
-  unsigned int default_arch;
 
   /* Get the canonical name for the default target CPU.  */
   if (*default_cpu == 'm')
@@ -7667,7 +7721,6 @@ md_show_usage (FILE *stream)
     {
       if (strcasecmp (default_cpu, m68k_cpus[i].name) == 0)
        {
-         default_arch = m68k_cpus[i].arch;
          while (m68k_cpus[i].alias > 0)
            i--;
          while (m68k_cpus[i].alias < 0)
This page took 0.026954 seconds and 4 git commands to generate.