* config/tc-bfin.c (Expr_Node_Gen_Reloc): If have symbol + constant,
authorBernd Schmidt <bernds@codesourcery.com>
Mon, 24 Oct 2005 18:35:59 +0000 (18:35 +0000)
committerBernd Schmidt <bernds@codesourcery.com>
Mon, 24 Oct 2005 18:35:59 +0000 (18:35 +0000)
make a single reloc with an offset rather than a stack.
* config/tc-bfin.h (MD_APPLY_SYM_VALUE): Define to 0.

gas/ChangeLog
gas/config/tc-bfin.c
gas/config/tc-bfin.h

index 440323f56fc8a40a4d9e2d3f1c8c6993c10d522e..ce5c72b56572b4d3ed7886d15847127e96c47ec6 100644 (file)
@@ -1,3 +1,9 @@
+2005-10-24  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+       * config/tc-bfin.c (Expr_Node_Gen_Reloc): If have symbol + constant,
+       make a single reloc with an offset rather than a stack.
+       * config/tc-bfin.h (MD_APPLY_SYM_VALUE): Define to 0.
+
 2005-10-24  Alexandre Oliva  <aoliva@redhat.com>
 
        * read.c (potable): Add weakref.
 2005-10-24  Alexandre Oliva  <aoliva@redhat.com>
 
        * read.c (potable): Add weakref.
index a1b3971d6fd7397c14c33d8d7a6162b8dd449acf..d9e88de19d51e4c84f9572fe0fb83d73d3613cb9 100644 (file)
@@ -1003,6 +1003,21 @@ Expr_Node_Gen_Reloc (Expr_Node * head, int parent_reloc)
       if (note1 != NULL_CODE)
        note = conscode (note1, note);
     }
       if (note1 != NULL_CODE)
        note = conscode (note1, note);
     }
+  else if (head->type == Expr_Node_Binop
+          && (head->value.op_value == Expr_Op_Type_Add
+              || head->value.op_value == Expr_Op_Type_Sub)
+          && head->Left_Child->type == Expr_Node_Reloc
+          && head->Right_Child->type == Expr_Node_Constant)
+    {
+      int val = head->Right_Child->value.i_value;
+      if (head->value.op_value == Expr_Op_Type_Sub)
+       val = -val;
+      note = conscode (note_reloc2 (gencode (0), head->Left_Child->value.s_value,
+                                   parent_reloc, val, 0),
+                      NULL_CODE);
+      if (note1 != NULL_CODE)
+       note = conscode (note1, note);
+    }
   else
     {
       /* Call the recursive function.  */
   else
     {
       /* Call the recursive function.  */
index 9252e25d9a77abf65a77e1cc7ee14205985127b8..773030cbb720c7526889a0da5bd69ae95f78fc1f 100644 (file)
@@ -72,4 +72,7 @@ extern int bfin_force_relocation PARAMS ((struct fix *));
 #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
 extern long md_pcrel_from_section PARAMS ((struct fix *, segT));
 
 #define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
 extern long md_pcrel_from_section PARAMS ((struct fix *, segT));
 
+/* Values passed to md_apply_fix3 don't include symbol values.  */
+#define MD_APPLY_SYM_VALUE(FIX) 0
+
 /* end of tc-bfin.h */
 /* end of tc-bfin.h */