aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorTrevor Smigiel <Trevor_Smigiel@playstation.sony.com>2009-07-24 19:51:27 +0000
committerTrevor Smigiel <Trevor_Smigiel@playstation.sony.com>2009-07-24 19:51:27 +0000
commit8fdcc58daafe1153d2edf18a2f106d2b247e1f01 (patch)
tree12dd0108e2284f8bcf70a761b5e6dcae9f60d7bf /bfd
parent309d33736f82fece9dbeae7a4ba096cdc2d77753 (diff)
downloadgdb-8fdcc58daafe1153d2edf18a2f106d2b247e1f01.zip
gdb-8fdcc58daafe1153d2edf18a2f106d2b247e1f01.tar.gz
gdb-8fdcc58daafe1153d2edf18a2f106d2b247e1f01.tar.bz2
include/elf/
* spu.h (R_SPU_ADD_PIC): New. bfd/ * reloc.c (BFD_RELOC_SPU_ADD_PIC): Define. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf32-spu.c (elf_howto_table): Add entries SPU_ADD_PIC. (spu_elf_bfd_to_reloc_type): Handle SPU_ADD_PIC. (spu_elf_relocate_section): Patch instructions marked by SPU_ADD_PIC. gas/ * config/tc-spu.c (md_apply_fix): Handle SPU_ADD_PIC. * config/tc-spu.h (tc_fix_adjustable): Don't adjust for SPU_ADD_PIC. (TC_FORCE_RELOCATION): Emit relocs for SPU_ADD_PIC. ld/testsuite/ * ld-spu/pic.d: New. * ld-spu/pic.s: New. * ld-spu/picdef.s: New.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog10
-rw-r--r--bfd/bfd-in2.h1
-rw-r--r--bfd/elf32-spu.c15
-rw-r--r--bfd/libbfd.h1
-rw-r--r--bfd/reloc.c2
5 files changed, 29 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f15da41..a4e8714 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,13 @@
+2009-07-24 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
+ Alan Modra <amodra@bigpond.net.au>
+
+ * reloc.c (BFD_RELOC_SPU_ADD_PIC): Define.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+ * elf32-spu.c (elf_howto_table): Add entries SPU_ADD_PIC.
+ (spu_elf_bfd_to_reloc_type): Handle SPU_ADD_PIC.
+ (spu_elf_relocate_section): Patch instructions marked by SPU_ADD_PIC.
+
2009-07-23 H.J. Lu <hongjiu.lu@intel.com>
PR ld/10434
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 562f833..6dff90b 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -2545,6 +2545,7 @@ relocation types already defined. */
BFD_RELOC_SPU_HI16,
BFD_RELOC_SPU_PPU32,
BFD_RELOC_SPU_PPU64,
+ BFD_RELOC_SPU_ADD_PIC,
/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
"addend" in some special way.
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index d03617a..b5c90a1 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -88,6 +88,9 @@ static reloc_howto_type elf_howto_table[] = {
HOWTO (R_SPU_PPU64, 0, 4, 64, FALSE, 0, complain_overflow_dont,
bfd_elf_generic_reloc, "SPU_PPU64",
FALSE, 0, -1, FALSE),
+ HOWTO (R_SPU_ADD_PIC, 0, 0, 0, FALSE, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "SPU_ADD_PIC",
+ FALSE, 0, 0x00000000, FALSE),
};
static struct bfd_elf_special_section const spu_elf_special_sections[] = {
@@ -135,6 +138,8 @@ spu_elf_bfd_to_reloc_type (bfd_reloc_code_real_type code)
return R_SPU_PPU32;
case BFD_RELOC_SPU_PPU64:
return R_SPU_PPU64;
+ case BFD_RELOC_SPU_ADD_PIC:
+ return R_SPU_ADD_PIC;
}
}
@@ -4841,6 +4846,16 @@ spu_elf_relocate_section (bfd *output_bfd,
if (info->relocatable)
continue;
+ /* Change "a rt,ra,rb" to "ai rt,ra,0". */
+ if (r_type == R_SPU_ADD_PIC && h != NULL
+ && (h->def_regular || ELF_COMMON_DEF_P (h)))
+ {
+ bfd_byte *loc = contents + rel->r_offset;
+ loc[0] = 0x1c;
+ loc[1] = 0x00;
+ loc[2] &= 0x3f;
+ }
+
is_ea_sym = (ea != NULL
&& sec != NULL
&& sec->output_section == ea);
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index d0499e8..28aa045 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -951,6 +951,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_SPU_HI16",
"BFD_RELOC_SPU_PPU32",
"BFD_RELOC_SPU_PPU64",
+ "BFD_RELOC_SPU_ADD_PIC",
"BFD_RELOC_ALPHA_GPDISP_HI16",
"BFD_RELOC_ALPHA_GPDISP_LO16",
"BFD_RELOC_ALPHA_GPDISP",
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 1f105de..2da43f3 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -2017,6 +2017,8 @@ ENUMX
BFD_RELOC_SPU_PPU32
ENUMX
BFD_RELOC_SPU_PPU64
+ENUMX
+ BFD_RELOC_SPU_ADD_PIC
ENUMDOC
SPU Relocations.