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] Gas support for MIPS Compact EH


"Moore, Catherine" <Catherine_Moore@mentor.com> writes:
>> -----Original Message-----
>> From: Richard Sandiford [mailto:rdsandiford@googlemail.com]
>> Subject: Re: [Patch] Gas support for MIPS Compact EH
>> 
>> "Moore, Catherine" <Catherine_Moore@mentor.com> writes:
>> 
>> > +/* Finish a pass over all .eh_frame and eh_frame_entry sections.  */
>> > +
>> > +bfd_boolean
>> >  _bfd_elf_end_eh_frame_parsing (struct bfd_link_info *info)  {
>> >    struct eh_frame_hdr_info *hdr_info;
>> > +  unsigned int i;
>> >
>> >    hdr_info = &elf_hash_table (info)->eh_info;
>> >    hdr_info->parsed_eh_frames = TRUE;
>> > +
>> > +  if (hdr_info->array_count == 0 || info->eh_frame_hdr < 2)
>> > +    return FALSE;
>> > +
>> > +  qsort (hdr_info->entries, hdr_info->array_count,
>> > +	 sizeof (asection *), cmp_eh_frame_hdr);
>> > +
>> > +  for (i = 0; i < hdr_info->array_count - 1; i++)
>> > +    {
>> > +      add_eh_frame_hdr_terminator (hdr_info->entries[i],
>> > +				   hdr_info->entries[i + 1]);
>> > +    }
>> > +
>> > +  /* Add a CANTUNWIND terminator after the last entry.  */
>> > + add_eh_frame_hdr_terminator (hdr_info->entries[i], NULL);  return
>> > + TRUE;
>> 
>> This routine is called from both bfd_elf_gc_sections and
>> bfd_elf_discard_info but I think you only want it for bfd_elf_discard_info.
>> So perhaps this should be a separate function.
>> 
>
> Quick question here -- perhaps what should be a separate function?
> Sorry, didn't quite understand that comment.

I just thought that the code you were adding here (to add terminators)
should go in a separate function that only gets called once, rather than
being part of _bfd_elf_end_eh_frame_parsing.

Thanks,
Richard


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