Comment 0 for bug 7509

Revision history for this message
In , Joshua Kwan (joshk) wrote :

Package: binutils
Version: 2.15-1
Severity: grave
Tags: upstream

Hi,

Here's some preprocessed code from
kernel-source-2.4.27/arch/sparc/lib/copy_user.S:

byte_chunk:
        ldub [%o1 - -0x02 - 0x02], %g2; ldub [%o1 - -0x02 - 0x01], %g3; stb %g2, [%o0 - -0x02 - 0x02]; stb %g3, [%o0 - -0x02 - 0x01];
        ldub [%o1 - -0x04 - 0x02], %g2; ldub [%o1 - -0x04 - 0x01], %g3; stb %g2, [%o0 - -0x04 - 0x02]; stb %g3, [%o0 - -0x04 - 0x01];
        ldub [%o1 - -0x06 - 0x02], %g2; ldub [%o1 - -0x06 - 0x01], %g3; stb %g2, [%o0 - -0x06 - 0x02]; stb %g3, [%o0 - -0x06 - 0x01];
        ldub [%o1 - -0x08 - 0x02], %g2; ldub [%o1 - -0x08 - 0x01], %g3; stb %g2, [%o0 - -0x08 - 0x02]; stb %g3, [%o0 - -0x08 - 0x01];
        ldub [%o1 - -0x0a - 0x02], %g2; ldub [%o1 - -0x0a - 0x01], %g3; stb %g2, [%o0 - -0x0a - 0x02]; stb %g3, [%o0 - -0x0a - 0x01];
        ldub [%o1 - -0x0c - 0x02], %g2; ldub [%o1 - -0x0c - 0x01], %g3; stb %g2, [%o0 - -0x0c - 0x02]; stb %g3, [%o0 - -0x0c - 0x01];
        ldub [%o1 - -0x0e - 0x02], %g2; ldub [%o1 - -0x0e - 0x01], %g3; stb %g2, [%o0 - -0x0e - 0x02]; stb %g3, [%o0 - -0x0e - 0x01];
        ldub [%o1 - -0x10 - 0x02], %g2; ldub [%o1 - -0x10 - 0x01], %g3; stb %g2, [%o0 - -0x10 - 0x02]; stb %g3, [%o0 - -0x10 - 0x01];

All were expansions of this #define:

#define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
        ldub [%src - offset - 0x02], %t0; \
        ldub [%src - offset - 0x01], %t1; \
        stb %t0, [%dst - offset - 0x02]; \
        stb %t1, [%dst - offset - 0x01];

Compiling it, I get

copy_user.S:300: Error: bad expression
copy_user.S:300: Error: bad expression
copy_user.S:300: Error: bad expression
copy_user.S:301: Error: bad expression
[...]

It seems that the double negative (as in ldub [%o1 - -0x10 - 0x02])
confuses as. Changing all occurrences of the double negative to + made
the code compile again, as it did in 2.14.90.0.7-8. This is pretty unacceptable
for sarge, as it breaks the build for many kernel versions back when this
macro first came into use, and it's perfectly valid sparc assembly as
far as I can tell.

Thanks..

-Josh

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: sparc (sparc64)
Kernel: Linux 2.6.8-1-sparc64
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (ignored: LC_ALL set to en_US.UTF-8)

Versions of packages binutils depends on:
ii libc6 2.3.2.ds1-15 GNU C Library: Shared libraries an

-- no debconf information