Subject: flag traps in ld.so
To: None <dall@hfrd.dsto.gov.au>
From: Ian Dall <dall@hfrd.dsto.gov.au>
List: port-pc532
Date: 09/27/1995 16:53:06
Ian Dall <dall@hfrd.dsto.gov.au> writes:

  > I have been trying to figure out why lites can't run dynamically linked
  > netbsd532 binaries.

  > It turns out that ld.so generates a "flag" trap by setting the flag
  > bit in the psr and then immediately executing the "flag" instruction.
  > My guess is that this is to allow a debugger to gain control and do
  > something with the symbols in the library.

  > I made lites treat a flag trap as a SIGFPE with a code to indicate it
  > is really a flag trap. Perhaps this wasn't the wisest decision, but there
  > is no SIGFLAG! So, in netbsd, how is a flag trap handled?

To partially answer my own question, the netbsd trap.c appears to
cause a kernal panic if it gets a flag trap in user mode. a) this
doesn't seem like a very good idea! User tasks shouldn't be able to
panic the kernel so easilly. b) if my understanding is correct, why is
ld.so generating the flag trap? When disassembled, this looks like
"real" code rather than some garbage that just happens to be
interpreted as a flag instruction, so it looks intentional.

Ian