gas 2.10.91 from 20000920 cvs is broken under hpux 10.20

Alan Modra alan@linuxcare.com.au
Fri Sep 22 23:11:00 GMT 2000


On Sat, 23 Sep 2000, John David Anglin wrote:

> Reverting to a snapshot from 20000906, there was no relocation information
> printed by objdump for the call:
> 
>  20c:   e8 5f 1b dd     b,l 0 <reset_used_flags>,rp
>  210:   08 00 02 40     nop
> 
> A similar recursive call in copy_rtx_if_shared has the relocation info:
> 
> 458:   e8 40 00 00     b,l 460 <copy_rtx_if_shared+0x460>,rp
>                        458: R_PCREL_CALL       copy_rtx_if_shared+0x40000000
> 45c:   08 00 02 40     nop
> 
> Checking the new linked version of cc1, the code looks ok for the call to
> reset_used_flags.  So, it appears that the R_PCREL_CALL relocation was added
> incorrectly by the new version of gas to a "local" branch with its offset
> setup by the assembler.

Err, it really look like I'm to blame.  Does this patch fix the problem?

Index: config/tc-hppa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-hppa.c,v
retrieving revision 1.66
diff -u -p -r1.66 tc-hppa.c
--- tc-hppa.c	2000/09/18 12:36:03	1.66
+++ tc-hppa.c	2000/09/23 06:04:34
@@ -8310,6 +8310,10 @@ hppa_fix_adjustable (fixp)
   if (fixp->fx_r_type == (int) R_PARISC_GNU_VTINHERIT
       || fixp->fx_r_type ==  (int) R_PARISC_GNU_VTENTRY)
     return 0;
+
+  if (fixp->fx_addsy && (S_IS_EXTERNAL (fixp->fx_addsy)
+			 || S_IS_WEAK (fixp->fx_addsy)))
+    return 0;
 #endif
 
   /* Reject reductions of symbols in sym1-sym2 expressions when
@@ -8372,10 +8376,6 @@ hppa_fix_adjustable (fixp)
       || hppa_fix->fx_r_field == e_lpsel)
     return 0;
 
-  if (fixp->fx_addsy && (S_IS_EXTERNAL (fixp->fx_addsy)
-			 || S_IS_WEAK (fixp->fx_addsy)))
-    return 0;
-
   /* Reject absolute calls (jumps).  */
   if (hppa_fix->fx_r_type == R_HPPA_ABS_CALL)
     return 0;
@@ -8414,13 +8414,13 @@ hppa_force_relocation (fixp)
   if (fixp->fx_r_type == (int) R_PARISC_GNU_VTINHERIT
       || fixp->fx_r_type == (int) R_PARISC_GNU_VTENTRY)
     return 1;
-#endif
 
   /* Ensure we emit a relocation for global symbols so that dynamic
      linking works.  */
   if (fixp->fx_addsy && (S_IS_EXTERNAL (fixp->fx_addsy)
 			 || S_IS_WEAK (fixp->fx_addsy)))
     return 1;
+#endif
 
   /* It is necessary to force PC-relative calls/jumps to have a relocation
      entry if they're going to need either a argument relocation or long

-- 
Linuxcare.  Support for the Revolution.



More information about the Binutils mailing list