Subject: Re: Illegal instruction on dynamic linked binaries
To: Harald Barth <haba@pdc.kth.se>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: port-sparc
Date: 02/25/1997 23:25:11
> 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:

The `iflush' in dynamically linked executables is there because an
instruction has just actually been changed in memory. `iflush' is
supposed to invalidate the (instruction) cache line, so the processor
will pick up the change next time around. In most(?) systems with split
instruction/data caches the instruction cache will not automatically
be updated when altering memory using "data accesses".

In this case, we probably need to decode the instruction causing the fault
and, upon discovering that it was an `iflush', flush the cache line
"manually".

-pk