* config/tc-a29k.c (md_apply_fix): Warn if an attempt is made to
authorIan Lance Taylor <ian@airs.com>
Thu, 9 Nov 1995 21:15:10 +0000 (21:15 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 9 Nov 1995 21:15:10 +0000 (21:15 +0000)
generate a reloc which the linker will not handle correctly.  Fix
overflow checking--R_IREL is 18 bits, not 17.

gas/config/tc-a29k.c

index 015d901..4c24f9e 100644 (file)
@@ -851,11 +851,21 @@ md_apply_fix (fixP, val)
 
     case RELOC_JUMPTARG:       /* 00XX00XX pattern in a word */
       if (!fixP->fx_done)
-       /* let linker deal */
-       ;
+       {
+         /* The linker tries to support both AMD and old GNU style
+             R_IREL relocs.  That means that if the addend is exactly
+             the negative of the address within the section, the
+             linker will not handle it correctly.  */
+         if (fixP->fx_pcrel
+             && val != 0
+             && val == - (fixP->fx_frag->fr_address + fixP->fx_where))
+           as_bad_where
+             (fixP->fx_file, fixP->fx_line,
+              "the linker will not handle this relocation correctly");
+       }
       else if (fixP->fx_pcrel)
        {
-         long v = val >> 16;
+         long v = val >> 17;
          if (v != 0 && v != -1)
            as_bad_where (fixP->fx_file, fixP->fx_line,
                          "call/jmp target out of range");