This is the mail archive of the
mailing list for the binutils project.
Re: [Patch, LD]Fix GDB crash caused by discarding the grouped debug sections
- From: Alan Modra <amodra at gmail dot com>
- To: Terry Guo <terry dot guo at arm dot com>
- Cc: binutils at sourceware dot org
- Date: Sun, 4 Jan 2015 19:38:05 +1030
- Subject: Re: [Patch, LD]Fix GDB crash caused by discarding the grouped debug sections
- Authentication-results: sourceware.org; auth=none
- References: <000001d01299$98ff5170$cafdf450$ at arm dot com> <20141208062856 dot GA31968 at bubble dot grove dot modra dot org> <000401d012b3$278be570$76a3b050$ at arm dot com> <20141208121137 dot GB31968 at bubble dot grove dot modra dot org> <003901d027cb$95edfa30$c1c9ee90$ at arm dot com>
On Sun, Jan 04, 2015 at 11:07:32AM +0800, Terry Guo wrote:
> +asection *
> +_bfd_elf_gc_mark_debug_special_section_group (asection *grp)
Why not make this function static?
> + /* Scan section group to either keep all included sections or
> + none of them. By setting iterator isec to the last member of
> + grouped sections, let the outer for loop skip those scanned
> + sections. */
I don't think you can count on all sections of a group being together,
so you can't skip over group sections.
> + if ((isec->flags & SEC_GROUP) != 0)
> + isec = _bfd_elf_gc_mark_debug_special_section_group (isec);
So the assignment above isn't valid, and you'll need to keep the
elf_next_in_group (isec) == NULL test below.
> + else if ((isec->flags & SEC_DEBUGGING) != 0
> + || (isec->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0)
> + isec->gc_mark = 1;
Australia Development Lab, IBM