This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch] Gas support for MIPS Compact EH
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "Moore\, Catherine" <Catherine_Moore at mentor dot com>
- Cc: "binutils\ at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 25 Mar 2014 14:06:45 +0000
- Subject: Re: [Patch] Gas support for MIPS Compact EH
- Authentication-results: sourceware.org; auth=none
- References: <FD3DCEAC5B03E9408544A1E416F11242F8FC5972 at NA-MBX-01 dot mgc dot mentorg dot com> <87k3me9jia dot fsf at talisman dot default> <FD3DCEAC5B03E9408544A1E416F11242012EAC2AE0 at NA-MBX-01 dot mgc dot mentorg dot com> <8738jt5zt1 dot fsf at talisman dot default> <FD3DCEAC5B03E9408544A1E416F1124201497E7D5E at NA-MBX-04 dot mgc dot mentorg dot com>
"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