This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Consensus on unit tests?
On 07/04/2016 03:06 PM, Florian Weimer wrote:
>> There is no precondition that I am aware of. I have clarified the
>> new patch to say "loadable segment" where I previously said
>> "segment" to make it more clear.
>
> Not even things like “a segment must not cover more than half of the
> address space” or “a segment must not cross the middle of the address
> space”? Or addr >= l->l_addr?
I see no reason why a segment can't cover more than half the address space
or cross the middle of the address space.
Equally there is nothing wrong with addr being greater than l->l_addr,
perhaps you meant less than or equal to, which would result in the reladdr
being wrapped.
> Intuitively, I would expect that a straight interval comparison as
> you wrote it, without any additional checks, would need an additional
> bit beyond the word size for it to be correct.
Could you expand on that?
I think the key here is that this is unsigned arithmetic.
--
Cheers,
Carlos.