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, LD]Fix GDB crash caused by discarding the grouped debug sections


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;

-- 
Alan Modra
Australia Development Lab, IBM


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