Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] Some tweaks for ELF



Maxime Villard <max%M00nBSD.net@localhost> writes:

>> - How often is_dyn is true?
>
> Most of the time, I think.

Hm, that's different from what I've expected.

> Whether it is true or not doesn't
> really matter, does it ?

It matters if possibility of "is_dyn is true case" and
"elf_check_header(eh, ET_EXEC) == 0 is true case" is different in some
degree.

>> 
>> - 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
>
> ?

Yes.

enami.


Home | Main Index | Thread Index | Old Index