Re: fs/binfmt_aout.o, Error: suffix or operands invalid for `cmp'[was Re: 2.6.1

From: H. Peter Anvin
Date: Fri Jun 23 2006 - 12:27:53 EST


Steven Rostedt wrote:

It's not (it's #APP, i.e. inline assembly); rather, it's an illegal
constraint.

It's GCC optimizing a little too much.


No, it's not... it's the author of the inline assembly who told gcc a lie at what it was allowed to optimize. The constraint is "g" (equivalent to "rmi"), but "rm" is the correct constraint.

There is already a patch in Andrew's repo for this.

>
#define __range_ok(addr,size) ({ \
unsigned long flag,sum; \
__chk_user_ptr(addr); \
asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0" \
:"=&r" (flag), "=r" (sum) \
:"1" (addr),"g" ((int)(size)),"g" (current_thread_info()->addr_limit.seg)); \
flag; })

What happened was that gcc optimized the
(current_thread_info()->addre_limit.seg to be a constant. Thus cmpl
failed.


... perfectly legally so, given the "g" constraint.

-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/