[PATCH,SPU] Add new relocation, R_SPU_ADD_PIC
Trevor_Smigiel@playstation.sony.com
Trevor_Smigiel@playstation.sony.com
Thu Jul 23 23:31:00 GMT 2009
Hi Alan,
Thanks. I have attached a patch with the requested changes.
I do not have write access to the binutils project. Can you request
access for me? Or is there someone else I can ask for access? I have
previously done the copyright assignments and have an account on
sourceware.org, but do not have access to the binutils project.
Thanks,
Trevor
* Alan Modra <amodra@bigpond.net.au> [2009-07-23 00:15]:
> On Thu, Jul 16, 2009 at 03:05:59PM -0700, Trevor_Smigiel@playstation.sony.com wrote:
> > @@ -4841,6 +4846,17 @@ spu_elf_relocate_section (bfd *output_bf
> > if (info->relocatable)
> > continue;
> >
> > + /* Change "a rt,ra,rb" to "ai rt,ra,0" */
>
> /* Change "a rt,ra,rb" to "ai rt,ra,0". */
>
> > + if (r_type == R_SPU_ADD_PIC && h
>
> Style nit. We normally write h != NULL here.
>
> > + && (h->root.type == bfd_link_hash_undefweak
> > + || h->root.type == bfd_link_hash_undefined))
>
> In your patch rationale, you mentioned dynamic linking support. If
> you'd like to use the right test with dynamic linking in mind, then
> write
> && (h->def_regular || ELF_COMMON_DEF_P (h)))
>
> This change is optional. Patch OK.
>
> --
> Alan Modra
> Australia Development Lab, IBM
2009-07-23 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
Alan Modra <amodra@bigpond.net.au>
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SPU_ADD_PIC.patch
Type: text/x-diff
Size: 8818 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20090723/9fc3f5c0/attachment.bin>
More information about the Binutils
mailing list