summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-03-15 03:28:51 +0000
committerAlan Modra <amodra@gmail.com>2009-03-15 03:28:51 +0000
commit30c665df3f6fb41cc4f9f342d03f4ec4d97a7a24 (patch)
tree82f4a4335085f792b25cf747e0a5f226d61c320c
parent0d34de9aeabd7bc5d027cfe6da2777a6db90423d (diff)
downloadppe42-binutils-30c665df3f6fb41cc4f9f342d03f4ec4d97a7a24.tar.gz
ppe42-binutils-30c665df3f6fb41cc4f9f342d03f4ec4d97a7a24.zip
* elf32-spu.c (build_stub): Correct icache set_id.
(spu_elf_relocate_section): Likewise.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-spu.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 77be5da7cc..33174a319b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-15 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-spu.c (build_stub): Correct icache set_id.
+ (spu_elf_relocate_section): Likewise.
+
2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
* xcofflink.c (xcoff_link_check_archive_element): Only free the
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index 115fa49c57..72ddccf25e 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -1330,7 +1330,7 @@ build_stub (struct bfd_link_info *info,
bfd_put_32 (sec->owner, dest_ovl - 1,
sec->contents + sec->size + 0);
- set_id = (dest_ovl - 1) >> htab->num_lines_log2;
+ set_id = ((dest_ovl - 1) >> htab->num_lines_log2) + 1;
bfd_put_32 (sec->owner, (set_id << 18) | (dest & 0x3ffff),
sec->contents + sec->size + 4);
bfd_put_32 (sec->owner, (lrlive << 29) | (g->br_addr & 0x3ffff),
@@ -4768,9 +4768,9 @@ spu_elf_relocate_section (bfd *output_bfd,
unsigned int ovl = overlay_index (sec);
if (ovl != 0)
{
- unsigned int set_id = (ovl - 1) >> htab->num_lines_log2;
+ unsigned int set_id = ((ovl - 1) >> htab->num_lines_log2) + 1;
relocation += set_id << 18;
- overlay_encoded = set_id != 0;
+ overlay_encoded = TRUE;
}
}
}
OpenPOWER on IntegriCloud