This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH,SPU] Add new relocation, R_SPU_ADD_PIC
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Trevor_Smigiel at playstation dot sony dot com, binutils at sourceware dot org, Ulrich Weigand <uweigand at de dot ibm dot com>, andrew_pinski at playstation dot sony dot com
- Date: Fri, 4 Sep 2009 16:26:58 +0930
- Subject: Re: [PATCH,SPU] Add new relocation, R_SPU_ADD_PIC
- References: <20090716220445.GX12536@playstation.sony.com> <20090716220559.GY12536@playstation.sony.com> <20090723070941.GK13233@bubble.grove.modra.org>
On Thu, Jul 23, 2009 at 04:39:41PM +0930, Alan Modra wrote:
> 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.
Oops, the above had a typo.
* elf32-spu.c (spu_elf_relocate_section): Correct 2009-07-24 logic.
Index: bfd/elf32-spu.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-spu.c,v
retrieving revision 1.88
diff -u -p -r1.88 elf32-spu.c
--- bfd/elf32-spu.c 5 Aug 2009 20:40:33 -0000 1.88
+++ bfd/elf32-spu.c 4 Sep 2009 06:49:49 -0000
@@ -4906,8 +4906,9 @@ spu_elf_relocate_section (bfd *output_bf
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)))
+ 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;
--
Alan Modra
Australia Development Lab, IBM