ia64-hpux patches from Steve Ellcey.
[deliverable/binutils-gdb.git] / gas / write.c
index e9e4f8a7e249b094648217b1465a36ea539a6d42..f30e0d0bc42d4f80303908a9f7fb6fc99c386798 100644 (file)
 #define TC_FORCE_RELOCATION_SECTION(FIXP,SEG) TC_FORCE_RELOCATION(FIXP)
 #endif
 
+#ifndef TC_LINKRELAX_FIXUP
+#define TC_LINKRELAX_FIXUP(SEG) 1
+#endif
+
+#ifndef TC_FIX_ADJUSTABLE
+#define TC_FIX_ADJUSTABLE(fix) 1
+#endif
+
 #ifndef        MD_PCREL_FROM_SECTION
 #define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from(FIXP)
 #endif
@@ -284,12 +292,12 @@ fix_new_exp (frag, where, size, exp, pcrel, r_type)
         the difference expression cannot immediately be reduced.  */
       {
        symbolS *stmp = make_expr_symbol (exp);
-       
+
        exp->X_op = O_symbol;
        exp->X_op_symbol = 0;
        exp->X_add_symbol = stmp;
        exp->X_add_number = 0;
-       
+
        return fix_new_exp (frag, where, size, exp, pcrel, r_type);
       }
 
@@ -891,7 +899,7 @@ write_relocs (abfd, sec, xxx)
      PTR xxx ATTRIBUTE_UNUSED;
 {
   segment_info_type *seginfo = seg_info (sec);
-  int i;
+  unsigned int i;
   unsigned int n;
   arelent **relocs;
   fixS *fixp;
@@ -1000,7 +1008,7 @@ write_relocs (abfd, sec, xxx)
        }
 
       /* If this is an undefined symbol which was equated to another
-         symbol, then use generate the reloc against the latter symbol
+         symbol, then generate the reloc against the latter symbol
          rather than the former.  */
       sym = fixp->fx_addsy;
       while (symbol_equated_p (sym)
@@ -1235,7 +1243,7 @@ relax_and_size_all_segments ()
   /* Join the 2 segments into 1 huge segment.
      To do this, re-compute every rn_address in the SEG_DATA frags.
      Then join the data frags after the text frags.
-    
+
      Determine a_data [length of data segment].  */
   if (data_frag_root)
     {
@@ -1497,7 +1505,7 @@ write_object_file ()
 
 #ifndef BFD_ASSEMBLER
   /* Crawl the symbol chain.
-    
+
      For each symbol whose value depends on a frag, take the address of
      that frag and subsume it into the value of the symbol.
      After this, there is just one way to lookup a symbol value.
@@ -1505,10 +1513,10 @@ write_object_file ()
      We adjust the values of 'L' local symbols, even if we do
      not intend to emit them to the object file, because their values
      are needed for fix-ups.
-    
+
      Unless we saw a -L flag, remove all symbols that begin with 'L'
      from the symbol chain.  (They are still pointed to by the fixes.)
-    
+
      Count the remaining symbols.
      Assign a symbol number to each symbol.
      Count the number of string-table chars we will emit.
@@ -2106,9 +2114,9 @@ relax_align (address, alignment)
 
 /* Now we have a segment, not a crowd of sub-segments, we can make
    fr_address values.
-  
+
    Relax the frags.
-  
+
    After this, all frags in this segment have addresses that are correct
    within the segment. Since segments live in different file addresses,
    these frag addresses may not be the same as final object-file
@@ -2204,7 +2212,7 @@ relax_segment (segment_frag_root, segment)
     do
       {
        stretch = stretched = 0;
-       
+
        for (fragP = segment_frag_root; fragP; fragP = fragP->fr_next)
          {
            long growth = 0;
@@ -2461,7 +2469,7 @@ fixup_segment (fixP, this_segment_type)
      i960 (the only machine for which we've got a relaxing linker right now),
      we might be able to turn callx/callj into bal anyways in cases where we
      know the maximum displacement.  */
-  if (linkrelax)
+  if (linkrelax && TC_LINKRELAX_FIXUP (this_segment_type))
     {
       for (; fixP; fixP = fixP->fx_next)
        seg_reloc_count++;
@@ -2706,17 +2714,8 @@ fixup_segment (fixP, this_segment_type)
              else
                {
                  seg_reloc_count++;
-#if !(defined (TC_V850) && defined (OBJ_ELF))
-#if !(defined (TC_M68K) && defined (OBJ_ELF))
-#if !(defined (TC_ARM)  && defined (OBJ_ELF))
-#if !(defined (TC_I960) && defined (OBJ_ELF))
-#if !defined (TC_I386) || !(defined (OBJ_ELF) || defined (OBJ_COFF)) || defined (TE_PE)
-                 add_number += S_GET_VALUE (add_symbolP);
-#endif
-#endif
-#endif
-#endif
-#endif
+                 if (TC_FIX_ADJUSTABLE (fixP))
+                   add_number += S_GET_VALUE (add_symbolP);
                }
            }
        }
This page took 0.024819 seconds and 4 git commands to generate.