[RFA] Don't sort PT_NOTE sections.
Michael Snyder
msnyder@cygnus.com
Wed Dec 12 13:21:00 GMT 2001
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);
More information about the Binutils
mailing list