This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[commit] SPU i-cache: Respect .brinfo lrlive bits for calls
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: binutils at sourceware dot org
- Date: Tue, 16 Jun 2009 15:47:19 +0200 (CEST)
- Subject: [commit] SPU i-cache: Respect .brinfo lrlive bits for calls
Hello,
we've noticed that the SPU linker currently ignores .brinfo lrlive bits
on *call* instructions (brsl etc) -- these get always the hard-coded
value of 5. This is incorrect; .brinfo is supposed to affect both
calls and branches. Only in the absence of an explicit .brinfo statement
is the linker supposed to make the distinction between calls (default 5)
and branches (default 1).
This is fixed by the following patch.
Tested on spu-elf with no regressions.
Approved off-line by Alan Modra; committed to mainline.
Bye,
Ulrich
ChangeLog:
* elf32-spu.c (needs_ovl_stub): Respect .brinfo lrlive bits
also for calls.
--- src/bfd/elf32-spu.c.orig 2009-06-15 19:12:17.000000000 +0200
+++ src/bfd/elf32-spu.c 2009-06-15 19:13:15.000000000 +0200
@@ -1010,18 +1010,14 @@ needs_ovl_stub (struct elf_link_hash_ent
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
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com