Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: [PATCH] Some tweaks for ELF
On 08/27/13 01:28, tsugutomo.enami%jp.sony.com@localhost wrote:
> Maxime Villard <max%M00nBSD.net@localhost> 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.
>
Home |
Main Index |
Thread Index |
Old Index