On 08/27/13 01:28, [email protected] wrote:
> Maxime Villard <[email protected]> writes:
>
>> * Put is_dyn before. It's just a small optimization:
>> elf_check_header(eh, ET_EXEC) is always called before checking
>> is_dyn, so if we invert the two things we avoid calling
>> elf_check_header() twice if is_dyn is ok.
>
> - How often is_dyn is true?
Most of the time, I think. Whether it is true or not doesn't
really matter, does it ?
>
> - Isn't it better to decouple file type check and the rest of validation
> to reduce duplicated tests completely?
What do you mean? Something like
if (elf_check_header(eh) != 0)
ERROR
if (eh->e_type != ET_DYN &&
eh->e_type != ET_EXEC)
ERROR
?
>
> enami.
>