]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix PR gas/11037.
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 16 Dec 2009 01:52:14 +0000 (01:52 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 16 Dec 2009 01:52:14 +0000 (01:52 +0000)
gas/

2009-12-15  H.J. Lu  <hongjiu.lu@intel.com>

Backport from trunk:
2009-12-07  H.J. Lu  <hongjiu.lu@intel.com>

PR gas/11037
* expr.c (resolve_expression): Call symbol_same_p to check
if 2 symbols are the same.

* symbols.c (symbol_same_p): New.
* symbols.h (symbol_same_p): Likewise.

gas/testsuite/

2009-12-15  H.J. Lu  <hongjiu.lu@intel.com>

Backport from trunk:
2009-12-07  H.J. Lu  <hongjiu.lu@intel.com>

PR gas/11037
* gas/i386/intelpic.s: Add testcases.
* gas/i386/intelpic.d: Updated.

2009-10-28  Alan Modra  <amodra@bigpond.net.au>

* gas/i386/intelpic.d: Correct.

2009-10-08  H.J. Lu  <hongjiu.lu@intel.com>

PR gas/10704
* gas/i386/intelpic.s: Add 2 new tests.
* gas/i386/intelpic.d: Updated.

gas/ChangeLog
gas/expr.c
gas/symbols.c
gas/symbols.h
gas/testsuite/ChangeLog
gas/testsuite/gas/i386/intelpic.d
gas/testsuite/gas/i386/intelpic.s

index e08ccfa2bcb8feb7fbc48aa58969593b7d9c1ce1..b5e639d8de3cb1b47f554f0352d202c1293c186b 100644 (file)
@@ -1,3 +1,15 @@
+2009-12-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       Backport from trunk:
+       2009-12-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gas/11037
+       * expr.c (resolve_expression): Call symbol_same_p to check
+       if 2 symbols are the same.
+
+       * symbols.c (symbol_same_p): New.
+       * symbols.h (symbol_same_p): Likewise.
+
 2009-12-03  Nick Clifton  <nickc@redhat.com>
 
        PR gas/11011
index 094141f6e3bbf2cfacf841f9bacef4074c1d538f..fbfdffc675830a62b99478efda1435b6d49a16d2 100644 (file)
@@ -2237,8 +2237,7 @@ resolve_expression (expressionS *expressionP)
        op = O_constant;
       else if (seg_left == reg_section && final_val == 0)
        op = O_register;
-      else if (seg_left == undefined_section
-              && add_symbol != orig_add_symbol)
+      else if (!symbol_same_p (add_symbol, orig_add_symbol))
        final_val += left;
       expressionP->X_add_symbol = add_symbol;
     }
index 4cfa85b103b0302879d5b2a948e1761442c66bee..5eda2cbbd2101ee6594b00884890d89767892015 100644 (file)
@@ -2385,6 +2385,20 @@ symbol_set_value_expression (symbolS *s, const expressionS *exp)
   S_CLEAR_WEAKREFR (s);
 }
 
+/* Return whether 2 symbols are the same.  */
+
+int
+symbol_same_p (symbolS *s1, symbolS *s2)
+{
+  if (s1->bsym == NULL
+      && local_symbol_converted_p ((struct local_symbol *) s1))
+    s1 = local_symbol_get_real_symbol ((struct local_symbol *) s1);
+  if (s2->bsym == NULL
+      && local_symbol_converted_p ((struct local_symbol *) s2))
+    s2 = local_symbol_get_real_symbol ((struct local_symbol *) s2);
+  return s1 == s2;
+}
+
 /* Return a pointer to the X_add_number component of a symbol.  */
 
 offsetT *
index 19f58c6f8f661e536f44f7fdc38de62f02601432..377a130074bd69a39f5220b72d3e3672ace392b7 100644 (file)
@@ -198,6 +198,7 @@ extern int symbol_constant_p (symbolS *);
 extern int symbol_shadow_p (symbolS *);
 extern asymbol *symbol_get_bfdsym (symbolS *);
 extern void symbol_set_bfdsym (symbolS *, asymbol *);
+extern int symbol_same_p (symbolS *, symbolS *);
 
 #ifdef OBJ_SYMFIELD_TYPE
 OBJ_SYMFIELD_TYPE *symbol_get_obj (symbolS *);
index 694128f495d5f98491c696830c5aea92d0fc28c3..1f73fe0a7b9e878f499ee98df036ca291186f24a 100644 (file)
@@ -1,3 +1,22 @@
+2009-12-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+       Backport from trunk:
+       2009-12-07  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gas/11037
+       * gas/i386/intelpic.s: Add testcases.
+       * gas/i386/intelpic.d: Updated.
+
+       2009-10-28  Alan Modra  <amodra@bigpond.net.au>
+
+       * gas/i386/intelpic.d: Correct.
+
+       2009-10-08  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gas/10704
+       * gas/i386/intelpic.s: Add 2 new tests.
+       * gas/i386/intelpic.d: Updated.
+
 2009-10-02  Peter Bergner  <bergner@vnet.ibm.com>
 
        * gas/ppc/476.s: New test.
index 4a689ec24e42a5c903a3f5fba79c2266672362a5..d78894a88155d0fee9a1f968e3eb170c7bc47ffa 100644 (file)
@@ -6,11 +6,22 @@
 
 Disassembly of section .text:
 
-0+000 <gs_foo>:
-   0:  c3 [    ]*ret    
+0+ <gs_foo>:
+[      ]*[a-f0-9]+:    c3                      ret    
 
-0+001 <bar>:
-   1:  8d 83 00 00 00 00 [     ]*lea    0x0\(%ebx\),%eax
-   7:  8b 83 00 00 00 00 [     ]*mov    0x0\(%ebx\),%eax
-   d:  90 [    ]*nop
-[      ]*...
+0+1 <bar>:
+[      ]*[a-f0-9]+:    8d 83 14 00 00 00       lea    0x14\(%ebx\),%eax
+[      ]*[a-f0-9]+:    8b 83 00 00 00 00       mov    0x0\(%ebx\),%eax
+[      ]*[a-f0-9]+:    ff 24 85 0d 00 00 00    jmp    \*0xd\(,%eax,4\)
+[      ]*[a-f0-9]+:    8d 83 14 00 00 00       lea    0x14\(%ebx\),%eax
+[      ]*[a-f0-9]+:    ff 24 85 0d 10 00 00    jmp    \*0x100d\(,%eax,4\)
+[      ]*[a-f0-9]+:    ff 24 85 28 10 00 00    jmp    \*0x1028\(,%eax,4\)
+[      ]*[a-f0-9]+:    90                      nop
+
+0+29 <L11>:
+[      ]*[a-f0-9]+:    ff 24 85 29 10 00 00    jmp    \*0x1029\(,%eax,4\)
+[      ]*[a-f0-9]+:    ff 24 85 37 10 00 00    jmp    \*0x1037\(,%eax,4\)
+
+0+37 <L12>:
+[      ]*[a-f0-9]+:    90                      nop
+#pass
index 2e7586437ef2f9dfd43958bf826c37124da7d29a..b8db43db20050c64c63b729c4e544898fb8dd3dd 100644 (file)
@@ -7,5 +7,17 @@ gs_foo:
 bar:
  lea   eax, .LC0@GOTOFF[ebx]
  mov   eax, DWORD PTR gs_foo@GOT[ebx]
- nop
-.p2align 4,0
+
+.L11:
+        jmp     DWORD PTR[ .L11  + eax * 4 ]
+.LC0:
+        lea     eax, DWORD PTR[ .LC0@GOTOFF + ebx ]
+        jmp     DWORD PTR[ .L11  + eax * 4 + 0x1000 ]
+        jmp     DWORD PTR[ .L12  + eax * 4 + 0x1000 ]
+.L12:
+       nop
+L11:
+        jmp     DWORD PTR[ L11  + eax * 4 + 0x1000 ]
+        jmp     DWORD PTR[ L12  + eax * 4 + 0x1000 ]
+L12:
+       nop