This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH,SPU] Generate .fixup section to support PIC


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]