gas reloc rewrite.
[binutils-gdb.git] / gas / config / tc-mn10300.c
index 101ff4416c448c21888a7b3eb0b8b1fbf6ae9e8a..012932b41ffe465950bd52f252931e43db7b35f8 100644 (file)
@@ -123,7 +123,7 @@ size_t md_longopts_size = sizeof (md_longopts);
 /* The target specific pseudo-ops which we support.  */
 const pseudo_typeS md_pseudo_table[] =
 {
-  { "file",     dwarf2_directive_file,  0 },
+  { "file",     (void (*) PARAMS ((int))) dwarf2_directive_file,  0 },
   { "loc",      dwarf2_directive_loc,   0 },
   { "am30",    set_arch_mach,          AM30 },
   { "am33",    set_arch_mach,          AM33 },
@@ -1806,7 +1806,7 @@ tc_gen_reloc (seg, fixp)
              reloc->howto = bfd_reloc_type_lookup (stdoutput,
                                                    BFD_RELOC_8_PCREL);
              return reloc;
-             
+
            case BFD_RELOC_16:
              reloc->howto = bfd_reloc_type_lookup (stdoutput,
                                                    BFD_RELOC_16_PCREL);
@@ -1846,7 +1846,7 @@ tc_gen_reloc (seg, fixp)
            case BFD_RELOC_8:
              md_number_to_chars (fixpos, reloc->addend, 1);
              break;
-             
+
            case BFD_RELOC_16:
              md_number_to_chars (fixpos, reloc->addend, 2);
              break;
@@ -2002,16 +2002,7 @@ mn10300_force_relocation (fixp)
       || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
     return 1;
 
-  /* Do not adjust relocations involving symbols in code sections,
-     because it breaks linker relaxations.  This could be fixed in the
-     linker, but this fix is simpler, and it pretty much only affects
-     object size a little bit.  */
-  if ((S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_CODE)
-      && fixp->fx_subsy
-      && S_GET_SEGMENT (fixp->fx_addsy) == S_GET_SEGMENT (fixp->fx_subsy))
-    return 1;
-
-  return 0;
+  return S_FORCE_RELOC (fixp->fx_addsy);
 }
 
 /* Return zero if the fixup in fixp should be left alone and not
@@ -2021,10 +2012,6 @@ boolean
 mn10300_fix_adjustable (fixp)
      struct fix *fixp;
 {
-  /* Prevent all adjustments to global symbols.  */
-  if (S_IS_EXTERN (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy))
-    return 0;
-
   if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
       || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
     return 0;