Subject: Re: NetBSD-1.5.3/pc532
To: Jon Buller <jon@bullers.net>
From: Ian Dall <ian@beware.dropbear.id.au>
List: port-pc532
Date: 03/31/2002 23:04:01
Thanks for the snapshot. I finally installed it without problems.
A disclaimer is that I only did an upgrade in place. I didn't attempt
an clean install, so never tested the sysinst stuff.

After installing, I needed to build myself a kernel since GENERIC
doesn't have ipfilter and friends. Here I ran into a few minor problems.

1. I needed to upgrade config first --- standard annoyance
2. machine/psl.h now needs to be split into machine/intr.h and machine/psl.h
   which I did.
3. When the kernel finally linked I got a number of warning messages of the
   form:

     ld: Double word displacement -535681672, out of range

   At first I assumed this was some toolchain problem, and tried using an
   old linker and an old assembler, but to no effect.

   Finally I looked at the sources for ld. In
   "libexec/ld.aout.so/arch/ns32k/md.c" I found the following:

	case 4:
#if 1
		if (val < -0x1f000000 || val >= 0x20000000)
#else
		if (val < -0x20000000 || val >= 0x20000000)
#endif
			warnx("Double word displacement %ld, out of range", val);

    This is wrong. The correct test is the second one. The compiler
    can generate code which violates the first test. Mostly it is not
    really trying to generate real addresses with such large
    displacements, but instead trying to use the addressing hardware
    to do arithmetic. I am still a bit puzzled by why these occur in
    practice.  The compiler should only use this method when it
    *knows* that the values will fit inside a displacement, and in
    general it can't know that for relocatable quantities. If it
    wasn't a relocatable, then why is ld fiddling with it? Anyway, the
    long and short of it is that my kernel seems to work OK and these
    warning messages are spurios. They can be ignored.

Ian