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] Create just one PT_NOTE for consecutive loadable .note* sections instead of one for each section


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


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