lkml.org 
[lkml]   [2009]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [GIT PULL] core kernel fixes

* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Fri, 10 Jul 2009, Ingo Molnar wrote:
> > >
> > > but I really migth have done soemthing wrong there. It's a
> > > simple function, but somebody needs to double-check that I
> > > haven't made it worse.
> >
> > Looks correct to me.
>
> Note, I didn't look at how 'end' works, and it really does matter
> if 'end' is an "inclusive" or "exclusive" end pointer address. So
> my replacement overlap() function was written more as a conceptual
> patch - I did not check the exact semantics of the arguments
> passed in.
>
> If 'end' is exclusive, then 'b1' should be calculated as
> 'a1+size-1', because the ranges must have the same rules. And then
> you should use the 'strict inequality' operators for testing the
> ranges.

The ranges are inclusive in terms of non-overlap: we can have
adjacent ranges with b1==a2 or b2==a1 that are still considered
non-overlapping. Hence the sharp test you used (which is negated)
looks correct to me.

The end-of-range symbols we use:

if (overlap(addr, len, _text, _etext) ||
overlap(addr, len, __start_rodata, __end_rodata))

Are all at the first byte outside of the to-be-avoided range:

.text : {
_text = .; /* Text */
*(.text)
*(.text.*)
_etext = . ;
}

...

__param : AT(ADDR(__param) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start___param) = .; \
*(__param) \
VMLINUX_SYMBOL(__stop___param) = .; \
. = ALIGN((align)); \
VMLINUX_SYMBOL(__end_rodata) = .; \
} \

...

I think ...

Ingo


\
 
 \ /
  Last update: 2009-07-10 22:05    [W:0.222 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site