bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/21407] gas -relax option on SPARC generates incorrect code


From: jose.marchesi at oracle dot com
Subject: [Bug gas/21407] gas -relax option on SPARC generates incorrect code
Date: Mon, 24 Apr 2017 18:55:50 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=21407

--- Comment #3 from Jose E. Marchesi <jose.marchesi at oracle dot com> ---
My conclusion is that the real bug here is that GAS relaxes the CALL
instruction even if the fixup can't be fully resolved in md_apply_fix.  This
only happens in a.out targets.

This fixes it:

diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 030e10d..c6b4476 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -3585,7 +3585,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT segment
ATTRIBUTE_UNUSED)
          insn |= val & 0x3fffffff;

          /* See if we have a delay slot.  */
-         if (sparc_relax && fixP->fx_where + 8 <= fixP->fx_frag->fr_fix)
+         if (sparc_relax && !fixP->fx_addsy
+             && fixP->fx_where + 8 <= fixP->fx_frag->fr_fix)
            {
 #define G0             0
 #define O7             15

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]