diff options
author | Trevor Smigiel <Trevor_Smigiel@playstation.sony.com> | 2009-07-24 19:51:27 +0000 |
---|---|---|
committer | Trevor Smigiel <Trevor_Smigiel@playstation.sony.com> | 2009-07-24 19:51:27 +0000 |
commit | 8fdcc58daafe1153d2edf18a2f106d2b247e1f01 (patch) | |
tree | 12dd0108e2284f8bcf70a761b5e6dcae9f60d7bf /bfd/elf32-spu.c | |
parent | 309d33736f82fece9dbeae7a4ba096cdc2d77753 (diff) | |
download | gdb-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/elf32-spu.c')
-rw-r--r-- | bfd/elf32-spu.c | 15 |
1 files changed, 15 insertions, 0 deletions
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); |