* elf32-spu.c (find_function_stack_adjust): Handle sf instruction
authorUlrich Weigand <uweigand@de.ibm.com>
Wed, 11 Mar 2009 00:18:02 +0000 (00:18 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Wed, 11 Mar 2009 00:18:02 +0000 (00:18 +0000)
used to update stack pointer.

bfd/ChangeLog
bfd/elf32-spu.c

index 2d043f74ee89b0e5a2efd91a17a8637e5634c113..eac0087c2cffb05209d333bd31f5a0400067926b 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-11  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * elf32-spu.c (find_function_stack_adjust): Handle sf instruction
+       used to update stack pointer.
+
 2009-03-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR binutils/9921
index 3015cd65bee5721b781218a1358c6789350aa7a8..115fa49c570579b9c6dec7e29196cecb45763447 100644 (file)
@@ -2133,6 +2133,19 @@ find_function_stack_adjust (asection *sec,
              return reg[rt];
            }
        }
+      else if (buf[0] == 0x08 && (buf[1] & 0xe0) == 0 /* sf */)
+       {
+         int rb = ((buf[1] & 0x1f) << 2) | ((buf[2] & 0xc0) >> 6);
+
+         reg[rt] = reg[rb] - reg[ra];
+         if (rt == 1)
+           {
+             if (reg[rt] > 0)
+               break;
+             *sp_adjust = offset;
+             return reg[rt];
+           }
+       }
       else if ((buf[0] & 0xfc) == 0x40 /* il, ilh, ilhu, ila */)
        {
          if (buf[0] >= 0x42 /* ila */)