This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 1/3] ELF: Group PT_NOTE segments by section alignments
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
course).
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.
Cheers
Nick