Subject: Re: Illegal instruction on dynamic linked binaries
To: None <port-sparc@NetBSD.ORG>
From: Harald Barth <haba@pdc.kth.se>
List: port-sparc
Date: 02/13/1997 21:02:32
Hi again.

I wrote:
>I encounter a strange problem when using the current sparc
>distribution on a Sun4/690 (Just 1 processor, no vme devices
>connected). The kernel boots OK to single user, but all binaries that
>are dynamically linked dump with "Illegal Instruction". (...)


The instruction is iflush in /usr/libexec/ld.so compiled from
gnu/usr.bin/ld/sparc/md.c:

static __inline void /* Line 91 in md.c */
iflush(sp)
	jmpslot_t		*sp;
{
	__asm __volatile("iflush %0+0" : : "r" (sp));
	__asm __volatile("iflush %0+4" : : "r" (sp));
	__asm __volatile("iflush %0+8" : : "r" (sp));
}

I commented the assembler which gave me dynamic linked binaries that
do not dump core in /usr/libexec/ld.so. The question is if it is valid
to skip the iflush - or should I do something else instead ???? The
target machine is a Cypress 605 (see below).

Regards,
Harald.


Booting netbsd @ 0x4000
1155040+109808+66808+[71412+82637]=0x16eb91
(if this doesn't work, fix pmap_bootstrap4m in pmap.c)Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 1.2B (GENERIC) #11: Tue Dec 10 00:24:14 MET 1996
    pk@flambard:/usr/src/sys/arch/sparc/compile/GENERIC
real mem = 66633728
avail mem = 60338176
using 813 buffers containing 3330048 bytes of memory
bootpath: /iommu@f,e0000000/sbus@f,e0001000/dma@f,81000/esp@f,80000/sd@3,0
mainbus0 (root): SUNW,SPARCsystem-600
cpu0 at mainbus0: Cypress,CY605 @ 40 MHz, RT602 or WTL3171 FPU
cpu0: physical 64K combined cache (32 bytes/line) cache enabled
obio0 at mainbus0
clock0 at obio0 addr 0xf1200000: mk48t08 (eeprom)
timer0 at obio0 addr 0xf1300000 delay constant 1
zs0 at obio0 addr 0xf1100000 pri 12, softpri 6
zs0a: console i/o
zs1 at obio0 addr 0xf1000000 pri 12, softpri 6
audio0 at obio0 addr 0xf1500000 pri 13, softpri 4
[leds at obio0] addr 0xf1600000 not configured
iommu0 at mainbus0 ioaddr 0xe0000000: version 1/0, page-size 4096, range 64MB
sbus0 at iommu0: clock = 20 MHz
dma0 at sbus0 slot 15 offset 0x81000: rev esc
esp0 at dma0 slot 0xf offset 0x80000 pri 4: ESP200 25Mhz, target 7
scsibus0 at esp0
probe(esp0:3:0): max sync rate 10.00Mb/s
sd0 at scsibus0 targ 3 lun 0: <IBMRISC, 0664M1H, 5 51> SCSI2 0/direct fixed
sd0: 1920MB, 2857 cyl, 15 head, 91 sec, 512 bytes/sec
lebuffer0 at sbus0 slot 15 offset 0x40000
le0 at lebuffer0 slot 0xf offset 0x60000 pri 6: address 08:00:20:0e:65:ab
le0: 64 receive buffers, 16 transmit buffers
vme at iommu0 not configured
root on sd0a