diff options
| author | Andi Kleen <ak@muc.de> | 2002-09-03 05:43:59 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-09-03 05:43:59 -0700 |
| commit | efec05b7d8f9d68938a0440b82a25b05848c3bb7 (patch) | |
| tree | 5e61a974d1ba2b8829214f941d4b637ddea37e6e /include/linux | |
| parent | 618cb2b643bc4dcb43ada89804f102f3ceabe0f9 (diff) | |
[PATCH] Fix RELOC_HIDE miscompilation
RELOC_HIDE got miscompiled on gcc3.1/x86-64 in the access to softirq.c's per
cpu variables. This fixes the problem.
Clearly to hide the relocation the addition needs to be done after the
value obfuscation, not before.
I don't know if it triggers on other architectures (x86-64 is especially
stressf here because it has negative kernel addresses), but seems like the
right thing to do.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/compiler.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index eea3d3636e2a..6b19413b47a6 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -16,7 +16,7 @@ /* This macro obfuscates arithmetic on a variable address so that gcc shouldn't recognize the original var, and make assumptions about it */ #define RELOC_HIDE(ptr, off) \ - ({ __typeof__(ptr) __ptr; \ - __asm__ ("" : "=g"(__ptr) : "0"((void *)(ptr) + (off))); \ - __ptr; }) + ({ unsigned long __ptr; \ + __asm__ ("" : "=g"(__ptr) : "0"(ptr)); \ + (typeof(ptr)) (__ptr + (off)); }) #endif /* __LINUX_COMPILER_H */ |
