2.6.5+BK compile error: binfmt_elf on sparc64
Yes, the patch fixes the warnings, it compiles and runs. I don't know whether 0xf0000000 is the right TASK_SIZE for 32-bit binaries but it seems to be:
include/asm-sparc/page.h:#define PAGE_OFFSET 0xf0000000
=== arch/sparc64/kernel/binfmt_elf32.c 1.10 vs edited ==--- 1.10/arch/sparc64/kernel/binfmt_elf32.c Mon Feb 23 20:12:56 2004
+++ edited/arch/sparc64/kernel/binfmt_elf32.c Wed Apr 14 14:05:08 2004
@@ -151,4 +151,7 @@
#undef MODULE_DESCRIPTION
#undef MODULE_AUTHOR
+#undef TASK_SIZE
+#define TASK_SIZE 0xf0000000
+
#include "../../../fs/binfmt_elf.c"
Quoted 30 lines
Quoted 8 lines
Because of -Werror, it bails out:
In file included from
arch/sparc64/kernel/binfmt_elf32.c:154:fs/binfmt_elf.c: In function `load_elf_interp':fs/binfmt_elf.c:369: warning: comparison is always false due to limited range of data typefs/binfmt_elf.c: In function `load_elf_binary':fs/binfmt_elf.c:780: warning: comparison is always false due to limited range of data typeQuoted 6 lines
It's the comparision "
elf_ppnt->p_memsz>TASK_SIZE".
p_memszisElf32_Word,TASK_SIZEis defined as
#defineTASK_SIZE((unsigned long)-VPTE_SIZE)At the first glance I can't see what's wrong here.
Well, since "unsigned long" is 64 bits on 64 bits, then presumably
TASK_SIZEwill be a very large (> 2^32) number, right? Sincep_memszis only 32-bits it can never be >TASK_SIZEand so the comparison is always false.Since is the ELF loader for 32-bit binaries I imagine it should be comparing against the
TASK_SIZEthat's used on sparc32 kernels or something like that (0xf0000000I believe)So you probably need to add a
#undef
TASK_SIZE
#defineTASK_SIZE0xf0000000near the end of
arch/sparc64/kernel/binfmt_elf32.c(before the final include of the normalbinfmt_elf.cfile)
Signature · 1 line
Meelis Roos ([email protected])
Quoted 4 lines · On Wed, 14 Apr 2004 14:36:01 +0300 (EEST) Meelis Roos <[email protected]> wrote:
Yes, the patch fixes the warnings, it compiles and runs. I don't know whether
0xf0000000is the rightTASK_SIZEfor 32-bit binaries but it seems to be:
include/asm-sparc/page.h:#definePAGE_OFFSET0xf0000000
This seems like a fine way to deal with this warning, patch applied.