This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Create just one PT_NOTE for consecutive loadable .note* sections instead of one for each section
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com, roland at redhat dot com
- Date: Fri, 29 Jun 2007 10:28:31 +0930
- Subject: Re: [PATCH] Create just one PT_NOTE for consecutive loadable .note* sections instead of one for each section
- References: <20070628152903.GC4603@sunsite.mff.cuni.cz>
On Thu, Jun 28, 2007 at 05:29:03PM +0200, Jakub Jelinek wrote:
> * elf.c (get_program_header_size): Adjacent loadable .note*
> sections need just one PT_NOTE segment.
> (_bfd_elf_map_sections_to_segments): Likewise.
OK, but please add a comment explaining why it is necessary to
restrict this to notes with 4-byte alignment. It took me a little
while to figure out why..
> + while (count > 1)
> + {
> + m->sections[m->count - count--] = s;
> + BFD_ASSERT ((s->flags & SEC_THREAD_LOCAL) == 0);
> + s = s->next;
> + }
> + m->sections[m->count - 1] = s;
Probably not worth peeling off the last iteration of this loop (and
losing the BFD_ASSERT).
--
Alan Modra
IBM OzLabs - Linux Technology Centre