This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH,SPU] Generate .fixup section to support PIC
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Trevor_Smigiel at playstation dot sony dot com
- Cc: binutils at sourceware dot org, Ulrich Weigand <uweigand at de dot ibm dot com>, andrew_pinski at playstation dot sony dot com
- Date: Wed, 5 Aug 2009 15:07:58 +0930
- Subject: Re: [PATCH,SPU] Generate .fixup section to support PIC
- References: <20090805020447.GE26973@playstation.sony.com>
On Tue, Aug 04, 2009 at 07:04:47PM -0700, Trevor_Smigiel@playstation.sony.com wrote:
> @@ -595,6 +599,24 @@ spu_elf_create_sections (struct bfd_link
> s->contents = data;
> }
>
> + if (htab->params->emit_fixups)
> + {
> + asection *s;
> + flagword flags;
> + ibfd = info->input_bfds;
> + flags = SEC_LOAD | SEC_ALLOC | SEC_READONLY | SEC_HAS_CONTENTS
> + | SEC_IN_MEMORY;
Formatting.
flags = (SEC_LOAD | SEC_ALLOC | SEC_READONLY | SEC_HAS_CONTENTS
| SEC_IN_MEMORY);
> + s = bfd_make_section_anyway_with_flags (ibfd, ".fixup", flags);
> + if (s == NULL || !bfd_set_section_alignment (ibfd, s, 2))
> + return FALSE;
> + /* Set a minimum size of 4 for the sentinel. The real size will
> + be set later. */
> + if (!bfd_set_section_size (ibfd, s, 4))
> + return FALSE;
> + s->contents = bfd_zalloc (ibfd, 4);
Seems unnecessary to alloc and set size here. Leave this until
spu_elf_size_sections. Other than these two nits the patch looks good.
--
Alan Modra
Australia Development Lab, IBM