Re: [PATCH 1/4] elf: don't be afraid of overflow

2019-03-12 Thread Pavel Machek
On Mon 2019-03-11 20:10:06, Alexey Dobriyan wrote: > On Mon, Mar 11, 2019 at 12:04:23PM +0100, Pavel Machek wrote: > > On Mon 2019-02-04 23:27:15, Alexey Dobriyan wrote: > > > Number of ELF program headers is 16-bit by spec, so total size > > > comfortably fits into "unsigned int". > > > > If it c

Re: [PATCH 1/4] elf: don't be afraid of overflow

2019-03-11 Thread Alexey Dobriyan
On Mon, Mar 11, 2019 at 12:04:23PM +0100, Pavel Machek wrote: > On Mon 2019-02-04 23:27:15, Alexey Dobriyan wrote: > > Number of ELF program headers is 16-bit by spec, so total size > > comfortably fits into "unsigned int". > > If it can't overflow, gcc should know too, and optimize checks > out..

Re: [PATCH 1/4] elf: don't be afraid of overflow

2019-03-11 Thread Pavel Machek
On Mon 2019-02-04 23:27:15, Alexey Dobriyan wrote: > Number of ELF program headers is 16-bit by spec, so total size > comfortably fits into "unsigned int". If it can't overflow, gcc should know too, and optimize checks out... right? > @@ -429,13 +430,9 @@ static struct elf_phdr *load_elf_phdrs(st