* elf32-spu.c (needs_ovl_stub): Respect .brinfo lrlive bits
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 16 Jun 2009 13:44:00 +0000 (13:44 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Tue, 16 Jun 2009 13:44:00 +0000 (13:44 +0000)
also for calls.

bfd/ChangeLog
bfd/elf32-spu.c

index 8a6ad9fc0246269d51b80f119a17f50a85ce8ad9..e542819f5dde257c2b69f4b3cd9be065c709db59 100644 (file)
@@ -1,3 +1,8 @@
+2009-06-16  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * elf32-spu.c (needs_ovl_stub): Respect .brinfo lrlive bits
+       also for calls.
+
 2009-06-16  H.J. Lu  <hongjiu.lu@intel.com>
 
        * configure.in (elf): Add elf-ifunc.lo.
index af7afdbc675d081ed68eb3f99e692f30a46bbd48..e2449d4b8b1beff3c54e6c4f2c995231e989de55 100644 (file)
@@ -1014,18 +1014,14 @@ needs_ovl_stub (struct elf_link_hash_entry *h,
   if (spu_elf_section_data (sym_sec->output_section)->u.o.ovl_index
        != spu_elf_section_data (input_section->output_section)->u.o.ovl_index)
     {
-      if (call || sym_type == STT_FUNC)
+      unsigned int lrlive = 0;
+      if (branch)
+       lrlive = (contents[1] & 0x70) >> 4;
+
+      if (!lrlive && (call || sym_type == STT_FUNC))
        ret = call_ovl_stub;
       else
-       {
-         ret = br000_ovl_stub;
-
-         if (branch)
-           {
-             unsigned int lrlive = (contents[1] & 0x70) >> 4;
-             ret += lrlive;
-           }
-       }
+       ret = br000_ovl_stub + lrlive;
     }
 
   /* If this insn isn't a branch then we are possibly taking the