Subject: re: cerror bug
To: Arne H Juul <arnej@math.ntnu.no>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: port-pmax
Date: 07/24/1998 20:27:07
>Well, I finally found the cause of a bug that's been troubling me
>for some time without really creating big trouble.
>Consider the following program:
>
>#include <stdio.h>
>int main(void)
>{
> if (stat("/foo/bar/baz")) perror("stat");
> if (rename("/foo/bar/baz", "/qux/quux/quuux")) perror("rename");
> exit(0);
>}

>This happens because the program will call the libposix.so "rename",
>the system call fails, the "rename" stub calls the common "cerror",
>which is in libc.so, but the "cerror" routing doesn't set the pointer
>to the libc.so GOT (?) as it should.  Here is the (quite simple) fix:

It'll show up in tomorrow's sup.  Thanks.  

BTW, could you send a PR with an example, and asking that we add this
test to the regress suite? It might just conceivably bite other some
RISC ports as they switch to ELF.