* config/tc-mips.c (md_pcrel_from_section): Disallow PC relative
authorThiemo Seufer <ths@networkno.de>
Fri, 3 Nov 2006 16:27:41 +0000 (16:27 +0000)
committerThiemo Seufer <ths@networkno.de>
Fri, 3 Nov 2006 16:27:41 +0000 (16:27 +0000)
MIPS16 instructions referencing other sections, unless they are
external branches.

gas/ChangeLog
gas/config/tc-mips.c

index fbab72c968fad7cc318cc0d429188e4a25f0c963..cb43b8463c8774fdb9df76886c9fcd6f7dcd9e45 100644 (file)
@@ -1,3 +1,9 @@
+2006-11-03  Thiemo Seufer  <ths@mips.com>
+
+       * config/tc-mips.c (md_pcrel_from_section): Disallow PC relative
+       MIPS16 instructions referencing other sections, unless they are
+       external branches.
+
 2006-11-03  Thiemo Seufer  <ths@mips.com>
 
        * config/tc-mips.c (mips_cpu_info_table): The 25Kf is a MIPS64
index 4eca5bb81e728a98e650253c64d7b1c7a11a40da..ea294e9c149f0120d75938f3d28618a0783a816f 100644 (file)
@@ -11544,6 +11544,10 @@ md_pcrel_from (fixS *fixP)
       /* Return the address of the delay slot.  */
       return addr + 4;
     default:
+      /* We have no relocation type for PC relative MIPS16 intructions.  */
+      if (fixP->fx_addsy && S_GET_SEGMENT (fixP->fx_addsy) != now_seg)
+       as_bad_where (fixP->fx_file, fixP->fx_line,
+                     _("PC relative MIPS16 instruction references a different section"));
       return addr;
     }
 }