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


Hi Alan,

Thanks for the review.

> 
> > +      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.

You're right. (Of course.)  I just removed it and tested again and it
was fine.  

Before checking in I made one other minor change.  I wrapped the .fixup
section with KEEP() in elf32_spu.sh to prevent it from getting removed
by -gc-sections.  To make it work properly without using KEEP(), I think
I would need to create the __fixup_start symbols as part of the .fixup
input section.

Trevor


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