Exceptions: the "gij bug"

Bryce McKinlay bryce@albatross.co.nz
Mon Dec 13 03:16:00 GMT 1999


Anthony Green wrote:

> I blame the current broken scheme used to manage libgcc.a.
>
> $ cat E.java
> import java.io.*;
>
> public class E
> {
>   public static void main (String[] args) throws Exception
>     {
>       throw new IOException();
>     }
> }
>
> $ gcj -o E --main=E E.java
> $ nm E | grep __throw
> $ ./E
> Aborted
> $ gcj -o E --main=E E.java -Wl,-u,__throw
> $ nm E | grep __throw
> 0804a760 T __throw
> 08049670 T __throw_type_match
> $ ./E
> java.io.IOException
>
> libgcc should really be a system wide shared library.
>
> The runtime linker is bringing parts of libgcc in from different
> shared libraries.  What's happening in the end is that the various
> libgcc objects that end up linked together are not internally
> consistant with one another.
>
> Here's my proposed `fix' (although I've omitted the rebuilt configure
> script) .  Let me know if this works for you...

Cool - that definitely seems to have been the problem. The fix seems to work for
me!

regards

  [ bryce ]




More information about the Java mailing list