[PATCH,SPU] Generate .fixup section to support PIC
Alan Modra
amodra@bigpond.net.au
Wed Aug 5 05:38:00 GMT 2009
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
More information about the Binutils
mailing list