[PATCH] PPC64 Poor assembly coding style

Doug Maxey dwm at austin.ibm.com
Wed Nov 10 10:03:13 EST 2004


On Tue, 09 Nov 2004 10:12:52 +1030, Alan Modra wrote:
>On Mon, Nov 08, 2004 at 12:16:19PM -0600, Linas Vepstas wrote:
>> The new assembler seems to be mistaking NR_syscalls for a register
>> number, which is clearly out of bounds (its not in 0..31).
>
>Testcase?

I tripped over this while trying to build both rh and suse distro kernels
on one machine.   Seemed easier to just have the same compiler level
for both, the rh rpm version is 3.4.2, so I got real brave and built from 
scratch. 8)

compile arch/ppc64/kernel/entry.S with gcc_3_4_2_release.  Binutils is 
binutils-2.15.92.0.2

This particular history is from the, ahem, distro sources.  Different error 
in the mainline sources.  

Is there a set of patches to get this version of the toolchain up to snuff?

++doug

COMMAND=={make}
ARGS={O=/build/dwm/build/s9-sp1-1103.edit/ppc64 zImage}
STARTED  Tue Nov  9 16:21:15 2004  ON  io-browns
 
cmd=={make O=/build/dwm/build/s9-sp1-1103.edit/ppc64 zImage}
  Using /build/dwm/linux/s9-sp1-1103.edit as source for kernel
  CHK     include/linux/version.h
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/split-include
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/genksyms/genksyms.o
  HOSTCC  scripts/genksyms/lex.o
  HOSTCC  scripts/genksyms/parse.o
  HOSTLD  scripts/genksyms/genksyms
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/kallsyms
  CC      scripts/empty.o
  HOSTCC  scripts/mk_elfconfig
  MKELF   scripts/elfconfig.h
  HOSTCC  scripts/file2alias.o
  HOSTCC  scripts/modpost.o
  HOSTCC  scripts/sumversion.o
  HOSTLD  scripts/modpost
  HOSTCC  scripts/pnmtologo
  HOSTCC  scripts/bin2c
  CC      arch/ppc64/kernel/asm-offsets.s
  CHK     include/asm-ppc64/offsets.h
  CC      init/main.o
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  CC      init/do_mounts.o
  CC      init/do_mounts_rd.o
/build/dwm/linux/s9-sp1-1103.edit/init/do_mounts_rd.c:309: warning: conflicting types for built-in function 'malloc'
  CC      init/do_mounts_initrd.o
  CC      init/do_mounts_md.o
  LD      init/mounts.o
  CC      init/initramfs.o
  LD      init/built-in.o
  CC      init/kerntypes.o
  HOSTCC  usr/gen_init_cpio
  CPIO    usr/initramfs_data.cpio
  GZIP    usr/initramfs_data.cpio.gz
  AS      usr/initramfs_data.o
  LD      usr/built-in.o
  CC      arch/ppc64/kernel/setup.o
/build/dwm/linux/s9-sp1-1103.edit/arch/ppc64/kernel/setup.c: In function `set_preferred_console':
/build/dwm/linux/s9-sp1-1103.edit/arch/ppc64/kernel/setup.c:477: warning: 'offset' might be used uninitialized in this function
  AS      arch/ppc64/kernel/entry.o
/build/dwm/linux/s9-sp1-1103.edit/arch/ppc64/kernel/entry.S: Assembler messages:
/build/dwm/linux/s9-sp1-1103.edit/arch/ppc64/kernel/entry.S:100: Error: operand out of range (268 is not between 0 and 31)
/build/dwm/linux/s9-sp1-1103.edit/arch/ppc64/kernel/entry.S:100: Error: missing operand
/build/dwm/linux/s9-sp1-1103.edit/arch/ppc64/kernel/entry.S:164: Error: operand out of range (268 is not between 0 and 31)
/build/dwm/linux/s9-sp1-1103.edit/arch/ppc64/kernel/entry.S:164: Error: missing operand
/build/dwm/linux/s9-sp1-1103.edit/arch/ppc64/kernel/entry.S:239: Error: operand out of range (3 is not between 0 and 1)
/build/dwm/linux/s9-sp1-1103.edit/arch/ppc64/kernel/entry.S:239: Error: missing operand
/build/dwm/linux/s9-sp1-1103.edit/arch/ppc64/kernel/entry.S:242: Error: operand out of range (3 is not between 0 and 1)
/build/dwm/linux/s9-sp1-1103.edit/arch/ppc64/kernel/entry.S:242: Error: missing operand
make[2]: *** [arch/ppc64/kernel/entry.o] Error 1
make[1]: *** [arch/ppc64/kernel] Error 2
make: *** [zImage] Error 2
CC { Reading specs from /opt/gcc-3.4.2/lib/gcc/powerpc64-unknown-linux-gnu/3.4.2/specs
 Configured with: /build/dwm/toolchain/gcc-3.4.2/configure --prefix=/opt/gcc-3.4.2 --disable-multilib --with-ld=/opt/binutils-2.15.92.0.2/bin/ld --with-as=/opt/binutils-2.15.92.0.2/bin/as --enable-languages=c,c++,f77 --enable-altivec
 Thread model: posix
 gcc version 3.4.2
 }
UNAME  Linux io-browns 2.6.5-7.97-pseries64 #1 SMP Fri Jul 2 14:21:59 UTC 2004 ppc64 ppc64 ppc64 GNU/Linux
uid=1001(dwm) gid=100(users) groups=10(wheel),14(uucp),16(dialout),17(audio),33(video),100(users)
COMPLETE at  Tue Nov  9 16:21:29 2004 
RETURN from {make O=/build/dwm/build/s9-sp1-1103.edit/ppc64 zImage} is 2
ELAPSED time  0:00:14


source lines:
     98         andi.   r11,r10,_TIF_SYSCALL_TRACE
     99         bne-    50f
    100         cmpli   0,r0,NR_syscalls
    101         bge-    66f
    102 /*
...
    162         /* XXX check this - Anton */
    163         ld      r9,GPR9(r1)
    164         cmpli   0,r0,NR_syscalls
    165         bge-    66f
    166 /*
    167  * Need to vector to 32 Bit or default sys_call_table
...
    237         andi.   r4,r4,_TIF_SYSCALL_TRACE
    238         bne-    81f
    239         cmpi    0,r3,0
    240         bge     .ret_from_except
    241         b       .ret_from_syscall_1
    242 81:     cmpi    0,r3,0
    243         blt     .ret_from_syscall_2
    244         bl      .do_syscall_trace






More information about the Linuxppc64-dev mailing list