Automatic date update in version.in
[binutils-gdb.git] / bfd / elf32-microblaze.c
index 9d0a7ca49d9a19902ac62acb11b598de864850ec..5496d1613aa0d00416511f9929a94bd6b4d267de 100644 (file)
@@ -1,6 +1,6 @@
 /* Xilinx MicroBlaze-specific support for 32-bit ELF
 
-   Copyright 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+   Copyright (C) 2009-2016 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -44,11 +44,11 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
    /* This reloc does nothing.  */
    HOWTO (R_MICROBLAZE_NONE,   /* Type.  */
           0,                   /* Rightshift.  */
-          2,                   /* Size (0 = byte, 1 = short, 2 = long).  */
-          32,                  /* Bitsize.  */
+          3,                   /* Size (0 = byte, 1 = short, 2 = long).  */
+          0,                   /* Bitsize.  */
           FALSE,               /* PC_relative.  */
           0,                   /* Bitpos.  */
-          complain_overflow_bitfield,  /* Complain on overflow.  */
+          complain_overflow_dont,  /* Complain on overflow.  */
           NULL,                  /* Special Function.  */
           "R_MICROBLAZE_NONE",         /* Name.  */
           FALSE,               /* Partial Inplace.  */
@@ -179,11 +179,11 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
    /* This reloc does nothing.  Used for relaxation.  */
    HOWTO (R_MICROBLAZE_64_NONE,        /* Type.  */
           0,                   /* Rightshift.  */
-          2,                   /* Size (0 = byte, 1 = short, 2 = long).  */
-          32,                  /* Bitsize.  */
+          3,                   /* Size (0 = byte, 1 = short, 2 = long).  */
+          0,                   /* Bitsize.  */
           TRUE,                        /* PC_relative.  */
           0,                   /* Bitpos.  */
-          complain_overflow_bitfield,  /* Complain on overflow.  */
+          complain_overflow_dont, /* Complain on overflow.  */
           NULL,                  /* Special Function.  */
           "R_MICROBLAZE_64_NONE",/* Name.  */
           FALSE,               /* Partial Inplace.  */
@@ -643,13 +643,22 @@ microblaze_elf_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
                              arelent * cache_ptr,
                              Elf_Internal_Rela * dst)
 {
+  unsigned int r_type;
+
   if (!microblaze_elf_howto_table [R_MICROBLAZE_32])
     /* Initialize howto table if needed.  */
     microblaze_elf_howto_init ();
 
-  BFD_ASSERT (ELF32_R_TYPE (dst->r_info) < (unsigned int) R_MICROBLAZE_max);
+  r_type = ELF32_R_TYPE (dst->r_info);
+  if (r_type >= R_MICROBLAZE_max)
+    {
+      (*_bfd_error_handler) (_("%B: unrecognised MicroBlaze reloc number: %d"),
+                            abfd, r_type);
+      bfd_set_error (bfd_error_bad_value);
+      r_type = R_MICROBLAZE_NONE;
+    }
 
-  cache_ptr->howto = microblaze_elf_howto_table [ELF32_R_TYPE (dst->r_info)];
+  cache_ptr->howto = microblaze_elf_howto_table [r_type];
 }
 
 /* Microblaze ELF local labels start with 'L.' or '$L', not '.L'.  */
@@ -957,7 +966,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
       howto = microblaze_elf_howto_table[r_type];
       r_symndx = ELF32_R_SYM (rel->r_info);
 
-      if (info->relocatable)
+      if (bfd_link_relocatable (info))
        {
          /* This is a relocatable link.  We don't have to change
             anything, unless the reloc is against a section symbol,
@@ -1023,11 +1032,12 @@ microblaze_elf_relocate_section (bfd *output_bfd,
            {
              /* External symbol.  */
              bfd_boolean warned ATTRIBUTE_UNUSED;
+             bfd_boolean ignored ATTRIBUTE_UNUSED;
 
              RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
                                       r_symndx, symtab_hdr, sym_hashes,
                                       h, sec, relocation,
-                                      unresolved_reloc, warned);
+                                      unresolved_reloc, warned, ignored);
              sym_name = h->root.root.string;
            }
 
@@ -1235,13 +1245,16 @@ microblaze_elf_relocate_section (bfd *output_bfd,
                    bfd_boolean dyn =
                        elf_hash_table (info)->dynamic_sections_created;
 
-                   if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
-                       && (!info->shared || !SYMBOL_REFERENCES_LOCAL (info, h)))
+                   if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
+                                                        bfd_link_pic (info),
+                                                        h)
+                       && (!bfd_link_pic (info)
+                           || !SYMBOL_REFERENCES_LOCAL (info, h)))
                      indx = h->dynindx;
                  }
 
                /* Need to generate relocs ? */
-               if ((info->shared || indx != 0)
+               if ((bfd_link_pic (info) || indx != 0)
                    && (h == NULL
                    || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
                    || h->root.type != bfd_link_hash_undefweak))
@@ -1262,7 +1275,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
                    /* Process module-id */
                    if (IS_TLS_LD(tls_type))
                      {
-                       if (! info->shared)
+                       if (! bfd_link_pic (info))
                          {
                            bfd_put_32 (output_bfd, 1, htab->sgot->contents + off);
                          }
@@ -1327,7 +1340,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
 
                          /* Relocs for dyn symbols generated by
                             finish_dynamic_symbols */
-                         if (info->shared && h == NULL)
+                         if (bfd_link_pic (info) && h == NULL)
                            {
                              *offp |= 1;
                              microblaze_elf_output_dynamic_relocation (output_bfd,
@@ -1417,7 +1430,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
                    break;
                  }
 
-               if ((info->shared
+               if ((bfd_link_pic (info)
                     && (h == NULL
                         || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
                         || h->root.type != bfd_link_hash_undefweak)
@@ -1426,7 +1439,7 @@ microblaze_elf_relocate_section (bfd *output_bfd,
                             && h->dynindx != -1
                             && (!info->symbolic
                                 || !h->def_regular))))
-                   || (!info->shared
+                   || (!bfd_link_pic (info)
                        && h != NULL
                        && h->dynindx != -1
                        && !h->non_got_ref
@@ -1543,16 +1556,14 @@ microblaze_elf_relocate_section (bfd *output_bfd,
          switch (r)
            {
            case bfd_reloc_overflow:
-             if (!((*info->callbacks->reloc_overflow)
-                   (info, (h ? &h->root : NULL), name, howto->name,
-                    (bfd_vma) 0, input_bfd, input_section, offset)))
-               return FALSE;
+             (*info->callbacks->reloc_overflow)
+               (info, (h ? &h->root : NULL), name, howto->name,
+                (bfd_vma) 0, input_bfd, input_section, offset);
              break;
 
            case bfd_reloc_undefined:
-             if (!((*info->callbacks->undefined_symbol)
-                   (info, name, input_bfd, input_section, offset, TRUE)))
-               return FALSE;
+             (*info->callbacks->undefined_symbol)
+               (info, name, input_bfd, input_section, offset, TRUE);
              break;
 
            case bfd_reloc_outofrange:
@@ -1571,9 +1582,8 @@ microblaze_elf_relocate_section (bfd *output_bfd,
              errmsg = _("internal error: unknown error");
              /* Fall through.  */
            common_error:
-             if (!((*info->callbacks->warning)
-                   (info, errmsg, name, input_bfd, input_section, offset)))
-               return FALSE;
+             (*info->callbacks->warning) (info, errmsg, name, input_bfd,
+                                          input_section, offset);
              break;
            }
        }
@@ -1600,8 +1610,9 @@ microblaze_elf_merge_private_bfd_data (bfd * ibfd, bfd * obfd)
 /* Calculate fixup value for reference.  */
 
 static int
-calc_fixup (bfd_vma addr, asection *sec)
+calc_fixup (bfd_vma start, bfd_vma size, asection *sec)
 {
+  bfd_vma end = start + size;
   int i, fixup = 0;
 
   if (sec == NULL || sec->relax == NULL)
@@ -1610,11 +1621,12 @@ calc_fixup (bfd_vma addr, asection *sec)
   /* Look for addr in relax table, total fixup value.  */
   for (i = 0; i < sec->relax_count; i++)
     {
-      if (addr <= sec->relax[i].addr)
+      if (end <= sec->relax[i].addr)
         break;
+      if ((end != start) && (start > sec->relax[i].addr))
+        continue;
       fixup += sec->relax[i].size;
     }
-
   return fixup;
 }
 
@@ -1676,7 +1688,7 @@ microblaze_elf_relax_section (bfd *abfd,
   *again = FALSE;
 
   /* Only do this for a text section.  */
-  if (link_info->relocatable
+  if (bfd_link_relocatable (link_info)
       || (sec->flags & SEC_RELOC) == 0
       || (sec->reloc_count == 0)
       || (sec->flags & SEC_CODE) == 0)
@@ -1827,7 +1839,7 @@ microblaze_elf_relax_section (bfd *abfd,
          bfd_vma nraddr;
 
           /* Get the new reloc address.  */
-         nraddr = irel->r_offset - calc_fixup (irel->r_offset, sec);
+         nraddr = irel->r_offset - calc_fixup (irel->r_offset, 0, sec);
           switch ((enum elf_microblaze_reloc_type) ELF32_R_TYPE (irel->r_info))
            {
            default:
@@ -1845,7 +1857,7 @@ microblaze_elf_relax_section (bfd *abfd,
                  /* Only handle relocs against .text.  */
                  if (isym->st_shndx == shndx
                      && ELF32_ST_TYPE (isym->st_info) == STT_SECTION)
-                   irel->r_addend -= calc_fixup (irel->r_addend, sec);
+                   irel->r_addend -= calc_fixup (irel->r_addend, 0, sec);
                }
              break;
            case R_MICROBLAZE_NONE:
@@ -1855,8 +1867,8 @@ microblaze_elf_relax_section (bfd *abfd,
                int sfix, efix;
                bfd_vma target_address;
                target_address = irel->r_addend + irel->r_offset;
-               sfix = calc_fixup (irel->r_offset, sec);
-               efix = calc_fixup (target_address, sec);
+               sfix = calc_fixup (irel->r_offset, 0, sec);
+               efix = calc_fixup (target_address, 0, sec);
                irel->r_addend -= (efix - sfix);
                /* Should use HOWTO.  */
                microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset,
@@ -1870,8 +1882,8 @@ microblaze_elf_relax_section (bfd *abfd,
                int sfix, efix;
                bfd_vma target_address;
                target_address = irel->r_addend + irel->r_offset + INST_WORD_SIZE;
-               sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, sec);
-               efix = calc_fixup (target_address, sec);
+               sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec);
+               efix = calc_fixup (target_address, 0, sec);
                irel->r_addend -= (efix - sfix);
     microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset
                                        + INST_WORD_SIZE, irel->r_addend);
@@ -1934,7 +1946,7 @@ microblaze_elf_relax_section (bfd *abfd,
                             }
 
                         }
-                     irelscan->r_addend -= calc_fixup (irelscan->r_addend, sec);
+                     irelscan->r_addend -= calc_fixup (irelscan->r_addend, 0, sec);
                     }
                  else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM)
                    {
@@ -1965,6 +1977,7 @@ microblaze_elf_relax_section (bfd *abfd,
                        }
                      irelscan->r_addend -= calc_fixup (irel->r_addend
                                                        + isym->st_value,
+                                                       0,
                                                        sec);
                    }
                }
@@ -2005,7 +2018,7 @@ microblaze_elf_relax_section (bfd *abfd,
                      unsigned long instr = bfd_get_32 (abfd, ocontents + irelscan->r_offset);
                      immediate = instr & 0x0000ffff;
                      target_address = immediate;
-                     offset = calc_fixup (target_address, sec);
+                     offset = calc_fixup (target_address, 0, sec);
                      immediate -= offset;
                      irelscan->r_addend -= offset;
           microblaze_bfd_write_imm_value_32 (abfd, ocontents + irelscan->r_offset,
@@ -2052,7 +2065,7 @@ microblaze_elf_relax_section (bfd *abfd,
                                                 + INST_WORD_SIZE);
           immediate = (instr_hi & 0x0000ffff) << 16;
           immediate |= (instr_lo & 0x0000ffff);
-                     offset = calc_fixup (irelscan->r_addend, sec);
+                     offset = calc_fixup (irelscan->r_addend, 0, sec);
                      immediate -= offset;
                      irelscan->r_addend -= offset;
                    }
@@ -2097,7 +2110,7 @@ microblaze_elf_relax_section (bfd *abfd,
           immediate = (instr_hi & 0x0000ffff) << 16;
           immediate |= (instr_lo & 0x0000ffff);
                      target_address = immediate;
-                     offset = calc_fixup (target_address, sec);
+                     offset = calc_fixup (target_address, 0, sec);
                      immediate -= offset;
                      irelscan->r_addend -= offset;
           microblaze_bfd_write_imm_value_64 (abfd, ocontents
@@ -2112,24 +2125,30 @@ microblaze_elf_relax_section (bfd *abfd,
       for (isym = isymbuf; isym < isymend; isym++)
         {
           if (isym->st_shndx == shndx)
-           isym->st_value =- calc_fixup (isym->st_value, sec);
+            {
+              isym->st_value -= calc_fixup (isym->st_value, 0, sec);
+              if (isym->st_size)
+                isym->st_size -= calc_fixup (isym->st_value, isym->st_size, sec);
+            }
         }
 
       /* Now adjust the global symbols defined in this section.  */
       isym = isymbuf + symtab_hdr->sh_info;
-      isymend = isymbuf + (symtab_hdr->sh_size / sizeof (Elf32_External_Sym));
-      for (sym_index = 0; isym < isymend; isym++, sym_index++)
+      symcount =  (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)) - symtab_hdr->sh_info;
+      for (sym_index = 0; sym_index < symcount; sym_index++)
         {
           sym_hash = elf_sym_hashes (abfd)[sym_index];
-          if (isym->st_shndx == shndx
-              && (sym_hash->root.type == bfd_link_hash_defined
+          if ((sym_hash->root.type == bfd_link_hash_defined
                   || sym_hash->root.type == bfd_link_hash_defweak)
               && sym_hash->root.u.def.section == sec)
-           {
-             sym_hash->root.u.def.value -= calc_fixup (sym_hash->root.u.def.value,
-                                                       sec);
-           }
-       }
+            {
+              sym_hash->root.u.def.value -= calc_fixup (sym_hash->root.u.def.value,
+                                                        0, sec);
+              if (sym_hash->size)
+                sym_hash->size -= calc_fixup (sym_hash->root.u.def.value,
+                                              sym_hash->size, sec);
+            }
+        }
 
       /* Physically move the code and change the cooked size.  */
       dest = sec->relax[0].addr;
@@ -2311,7 +2330,7 @@ microblaze_elf_check_relocs (bfd * abfd,
   struct elf32_mb_link_hash_table *htab;
   asection *sreloc = NULL;
 
-  if (info->relocatable)
+  if (bfd_link_relocatable (info))
     return TRUE;
 
   htab = elf32_mb_hash_table (info);
@@ -2339,7 +2358,13 @@ microblaze_elf_check_relocs (bfd * abfd,
       if (r_symndx < symtab_hdr->sh_info)
         h = NULL;
       else
-        h = sym_hashes [r_symndx - symtab_hdr->sh_info];
+       {
+         h = sym_hashes [r_symndx - symtab_hdr->sh_info];
+
+         /* PR15323, ref flags aren't set for references in the same
+            object.  */
+         h->root.non_ir_ref = 1;
+       }
 
       switch (r_type)
         {
@@ -2398,7 +2423,7 @@ microblaze_elf_check_relocs (bfd * abfd,
         case R_MICROBLAZE_64_PCREL:
         case R_MICROBLAZE_32:
           {
-            if (h != NULL && !info->shared)
+            if (h != NULL && !bfd_link_pic (info))
              {
                /* we may need a copy reloc.  */
                h->non_got_ref = 1;
@@ -2432,14 +2457,14 @@ microblaze_elf_check_relocs (bfd * abfd,
               dynamic library if we manage to avoid copy relocs for the
               symbol.  */
 
-            if ((info->shared
+            if ((bfd_link_pic (info)
                  && (sec->flags & SEC_ALLOC) != 0
                  && (r_type != R_MICROBLAZE_64_PCREL
                      || (h != NULL
                         && (! info->symbolic
                             || h->root.type == bfd_link_hash_defweak
                             || !h->def_regular))))
-                || (!info->shared
+                || (!bfd_link_pic (info)
                     && (sec->flags & SEC_ALLOC) != 0
                     && h != NULL
                     && (h->root.type == bfd_link_hash_defweak
@@ -2538,11 +2563,11 @@ microblaze_elf_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info)
   htab->splt = bfd_get_linker_section (dynobj, ".plt");
   htab->srelplt = bfd_get_linker_section (dynobj, ".rela.plt");
   htab->sdynbss = bfd_get_linker_section (dynobj, ".dynbss");
-  if (!info->shared)
+  if (!bfd_link_pic (info))
     htab->srelbss = bfd_get_linker_section (dynobj, ".rela.bss");
 
   if (!htab->splt || !htab->srelplt || !htab->sdynbss
-      || (!info->shared && !htab->srelbss))
+      || (!bfd_link_pic (info) && !htab->srelbss))
     abort ();
 
   return TRUE;
@@ -2663,7 +2688,7 @@ microblaze_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
      only references to the symbol are via the global offset table.
      For such cases we need not do anything here; the relocations will
      be handled correctly by relocate_section.  */
-  if (info->shared)
+  if (bfd_link_pic (info))
     return TRUE;
 
   /* If there are no references to this symbol that do not use the
@@ -2770,7 +2795,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat)
             return FALSE;
         }
 
-      if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h))
+      if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
         {
           asection *s = htab->splt;
 
@@ -2785,7 +2810,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat)
              location in the .plt.  This is required to make function
              pointers compare as equal between the normal executable and
              the shared library.  */
-          if (! info->shared
+          if (! bfd_link_pic (info)
               && !h->def_regular)
             {
               h->root.u.def.section = s;
@@ -2875,7 +2900,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * dat)
      space for pc-relative relocs that have become local due to symbol
      visibility changes.  */
 
-  if (info->shared)
+  if (bfd_link_pic (info))
     {
       if (h->def_regular
          && (h->forced_local
@@ -2957,7 +2982,7 @@ microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
 
   /* Set up .got offsets for local syms, and space for local dynamic
      relocs.  */
-  for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+  for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
     {
       bfd_signed_vma *local_got;
       bfd_signed_vma *end_local_got;
@@ -3030,7 +3055,7 @@ microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
                {
                  *local_got = s->size;
                  s->size += need;
-                 if (info->shared)
+                 if (bfd_link_pic (info))
                    srel->size += need * (sizeof (Elf32_External_Rela) / 4);
                }
             }
@@ -3047,7 +3072,7 @@ microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
     {
       htab->tlsld_got.offset = htab->sgot->size;
       htab->sgot->size += 8;
-      if (info->shared)
+      if (bfd_link_pic (info))
         htab->srelgot->size += sizeof (Elf32_External_Rela);
     }
   else
@@ -3130,7 +3155,7 @@ microblaze_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
 #define add_dynamic_entry(TAG, VAL)                    \
       _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
-      if (info->executable)
+      if (bfd_link_executable (info))
         {
           if (!add_dynamic_entry (DT_DEBUG, 0))
             return FALSE;
@@ -3202,13 +3227,13 @@ microblaze_elf_finish_dynamic_symbol (bfd *output_bfd,
       got_addr = got_offset;
 
       /* For non-PIC objects we need absolute address of the GOT entry.  */
-      if (!info->shared)
+      if (!bfd_link_pic (info))
         got_addr += htab->sgotplt->output_section->vma + sgotplt->output_offset;
 
       /* Fill in the entry in the procedure linkage table.  */
       bfd_put_32 (output_bfd, PLT_ENTRY_WORD_0 + ((got_addr >> 16) & 0xffff),
                   splt->contents + h->plt.offset);
-      if (info->shared)
+      if (bfd_link_pic (info))
         bfd_put_32 (output_bfd, PLT_ENTRY_WORD_1 + (got_addr & 0xffff),
                     splt->contents + h->plt.offset + 4);
       else
@@ -3260,16 +3285,16 @@ microblaze_elf_finish_dynamic_symbol (bfd *output_bfd,
       BFD_ASSERT (sgot != NULL && srela != NULL);
 
       offset = (sgot->output_section->vma + sgot->output_offset
-                       + (h->got.offset &~ (bfd_vma) 1));
+               + (h->got.offset &~ (bfd_vma) 1));
 
       /* If this is a -Bsymbolic link, and the symbol is defined
          locally, we just want to emit a RELATIVE reloc.  Likewise if
          the symbol was forced to be local because of a version file.
          The entry in the global offset table will already have been
          initialized in the relocate_section function.  */
-      if (info->shared
-          && (info->symbolic || h->dynindx == -1)
-          && h->def_regular)
+      if (bfd_link_pic (info)
+          && ((info->symbolic && h->def_regular)
+             || h->dynindx == -1))
         {
           asection *sec = h->root.u.def.section;
           microblaze_elf_output_dynamic_relocation (output_bfd,
@@ -3375,13 +3400,13 @@ microblaze_elf_finish_dynamic_sections (bfd *output_bfd,
             {
               asection *s;
 
-              s = bfd_get_section_by_name (output_bfd, name);
+              s = bfd_get_linker_section (dynobj, name);
               if (s == NULL)
                 dyn.d_un.d_val = 0;
               else
                 {
                   if (! size)
-                    dyn.d_un.d_ptr = s->vma;
+                    dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
                   else
                     dyn.d_un.d_val = s->size;
                 }
@@ -3434,7 +3459,7 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
                                bfd_vma *valp)
 {
   if (sym->st_shndx == SHN_COMMON
-      && !info->relocatable
+      && !bfd_link_relocatable (info)
       && sym->st_size <= elf_gp_size (abfd))
     {
       /* Common symbols less than or equal to -G nn bytes are automatically
@@ -3450,10 +3475,10 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
   return TRUE;
 }
 
-#define TARGET_LITTLE_SYM      bfd_elf32_microblazeel_vec
+#define TARGET_LITTLE_SYM      microblaze_elf32_le_vec
 #define TARGET_LITTLE_NAME     "elf32-microblazeel"
 
-#define TARGET_BIG_SYM          bfd_elf32_microblaze_vec
+#define TARGET_BIG_SYM          microblaze_elf32_vec
 #define TARGET_BIG_NAME                "elf32-microblaze"
 
 #define ELF_ARCH               bfd_arch_microblaze