This is the mail archive of the binutils@sources.redhat.com 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]

[RFA] Don't sort PT_NOTE sections.



Sorting the PT_NOTE section has an unfortunate effect on a corefile.
Also there's no use sorting if count == 1.

2001-12-12  Michael Snyder  <msnyder@redhat.com>

	* elf.c (assign_file_positions_for_segments): Don't sort PT_NOTE
	sections.  Also it makes no sense to sort if count == 1.

Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.110
diff -c -3 -p -r1.110 elf.c
*** elf.c	2001/12/07 12:32:42	1.110
--- elf.c	2001/12/12 21:16:59
*************** assign_file_positions_for_segments (abfd
*** 3181,3188 ****
        asection **secpp;
  
        /* If elf_segment_map is not from map_sections_to_segments, the
!          sections may not be correctly ordered.  */
!       if (m->count > 0)
  	qsort (m->sections, (size_t) m->count, sizeof (asection *),
  	       elf_sort_sections);
  
--- 3181,3189 ----
        asection **secpp;
  
        /* If elf_segment_map is not from map_sections_to_segments, the
!          sections may not be correctly ordered.  NOTE: do not sort
!          sections of type PT_NOTE.  */
!       if (m->count > 1 && m->p_type != PT_NOTE)
  	qsort (m->sections, (size_t) m->count, sizeof (asection *),
  	       elf_sort_sections);
  


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