[PATCH 1/3] ELF: Group PT_NOTE segments by section alignments
Wed Oct 3 12:56:00 GMT 2018
On Wed, Oct 3, 2018 at 3:30 AM Nick Clifton <firstname.lastname@example.org> wrote:
> Hi H.J.
> One question:
> > + while (s->next != NULL
> > + && s->next->alignment_power == alignment_power
> > + && (s->next->flags & SEC_LOAD) != 0
> > + && CONST_STRNEQ (s->next->name, ".note"))
> > + s = s->next;
> I did not think that note sections were required to have a ".note"
> prefix to their name. So wouldn't it be better to check for a SHF_NOTE
> flag instead ? (Assuming that the section is in an ELF format bfd, of
> I appreciate that the code that you are patching also used the CONST_STRNEQ
> check, but I am thinking that now would be a good time to fix this bug
> as well. If the section is not in an ELF format file, you could always
> fall back on checking for the .note prefix.
get_program_header_size and _bfd_elf_map_sections_to_segments are only
used on ELF files. This updated patch checks SHT_NOTE section type instead.
OK for master?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4163 bytes
Desc: not available
More information about the Binutils